npm.io
1.0.2 • Published 8 years ago

betype

Licence
ISC
Version
1.0.2
Deps
0
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

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

Keywords