vanilla-type-check
Collection of functions for basic type checking.
Install
Install with npm
npm install vanilla-type-check
Usage
// import functions (better tree-shaking);;;;;;;;;;; // use the provided functions to check the type of an object (all of them return a Boolean);;;;;;;;;;;
Running tests
Install dev dependencies
npm install -d && npm test
2.0.3
- 2.0.2 published ts files. This fixes it publishing the proper built files.
2.0.2
- Other functions also return
value is TYPE
.
2.0.1
isArray(x: any)
now returnsx is any[]
to let typescript compiler know that isx
an array
Changes from 1.0.1 to 2.0.0
- Rewritten in typescript
- Removed dependencies
- Auto generated documentation
- New functions:
isBoolean
,isPlainObject
- Changed functions:
isEmptyObject
is nowisEmpty
and works with objects, arrays and DOM nodes - Each function is exported from a different file, to help treeshaking (old way still works)
- Improved test cases
Old way of importing files
// import all functions; typecheck;typecheck;typecheck;typecheck;typecheck;typecheck;typecheck;typecheck;typecheck;typecheck;typecheck;