typis
v1.1.1
Published
Check or get object type
Downloads
2,643
Maintainers
Readme
Installation
Node.js
npm install typis --save
Example
const type = require('typis');
console.log(type.get([])); //=> Array;
console.log(type.get(123)); //=> Number;
console.log(type.get(true)); //=> Boolean;
console.log(type.is(123, 'boolean')); //=> false;
// Throw an error
type.throw(123, 'boolean'); //=> error;
type.throw(123, 'boolean', 'your custom message error'); //=> error;
API
See full documentation
Changelog
You can view the changelog here
License
typis is open-sourced software licensed under the MIT license
Author
Fabio Ricali