A little library for asserting types and values, with zero dependencies. Follower for check-types (archived).
npm install check-types-2


A little JavaScript library
for asserting types
and values,
with zero dependencies.
This repository was forked from check-types.js
after the original project was archived. Thanks a lot to Phil Booth
for the original work!
* Why would I want that?
* How little is it?
* How do I install it?
* How do I use it?
* Loading the library
* Calling the exported functions
* General predicates
* String predicates
* Number predicates
* Boolean predicates
* Object predicates
* Array predicates
* Date predicates
* Function predicates
* Modifiers
* Batch operations
* Some examples
* Are there TypeScript definitions?
* Where can I use it?
* What changed from 10.x to 11.x?
* What changed from 9.x to 10.x?
* What changed from 8.x to 9.x?
* What changed from 7.x to 8.x?
* What changed from 6.x to 7.x?
* What changed from 5.x to 6.x?
* What changed from 4.x to 5.x?
* What changed from 3.x to 4.x?
* What changed from 2.x to 3.x?
* What changed from 1.x to 2.x?
* What changed from 0.x to 1.x?
* How do I set up the build environment?
* What license is it released under?
Writing explicit conditions
in your functions
to check arguments
and throw errors
is a task that
swiftly becomes tiresome
and adds complexity
to your codebase.
The purpose of check-types-2
is to remove this burden
from JavaScript application developers
in an efficient and robust manner,
abstracted by a simple API.
24 kb unminified with comments, 7.1 kb minified, 2.5 kb minified + gzipped.
Via npm:
```
npm i check-types-2 --save
Or if you just want the git repo:
``
git clone git@github.com:stheine/check-types-2.git
If you are running in Node.js
or a CommonJS environment,
you can require check-types like so:
`javascript`
const check = require('check-types-2');
It also the supports
the AMD-style format
preferred by Require.js.
If you are
including check-types-2
with an HTML