Napoleon's Pixelated Mugshot
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

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

Install

npm i typis

DownloadsWeekly Downloads

11

Version

1.1.1

License

MIT

Last publish

Collaborators

  • avatar