An open API service indexing awesome lists of open source software.

https://github.com/fabioricali/typis

Detects object type.
https://github.com/fabioricali/typis

checks javascript object types

Last synced: 6 months ago
JSON representation

Detects object type.

Awesome Lists containing this project

README

          


typis


Detects object type.







## Installation

### Node.js
```
npm install typis --save
```

## Example

```javascript
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