Betype is a basic JavaScript type checking package. That validate a value against a list of types and evaluate to true if any of the given value evaluate to true.
- Version 1.0.0
npm install betype --save
valueBeType(value, ...types);
instanceBeType(instance, ...types);
var {valueBeType} = require("betype");
const checkValueType = valueBeType("Wycliffe Peart", "string");
console.log(checkValueType);
Output => true
var {instanceBeType} = require("betype");
const checkInstanceType = instanceBeType({}, Object);
console.log(checkInstanceType);
Output => true