typis

1.1.1 • Public • Published

typis

Detects object type.

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

Package Sidebar

Install

npm i typis

Weekly Downloads

3

Version

1.1.1

License

MIT

Last publish

Collaborators

  • fabioricali