1.0.2 • Published 6 years ago
betype v1.0.2
Betype
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
Installation
npm install betype --save
Betype Functions
valueBeType(value, ...types);
instanceBeType(instance, ...types);
Examples
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