0.0.0 • Published 6 years ago

be-of-type v0.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

be-of-type

build status AppVeyor Build Status JavaScript Style Guide


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
}

/*...*/

License

MIT