be-of-type
v0.0.0
Published
basic type assertions
Downloads
3
Readme
be-of-type
Basic type assertions.
Get it
npm install --save be-of-type
Usage
Most useful as a set of building blocks for setting up narrow and targeted type assertions.
const be = require('be-of-type')
const is = {
bool: be.boolean,
buffer: be.buffer,
nonEmptyStringArray: x => be.array(x) && x.length && x.every(be.string),
pojo: be.plainObject,
uInt: x => be.number(x) && x >= 0 && x % 1 === 0
}
/*...*/