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.
- Host: GitHub
- URL: https://github.com/fabioricali/typis
- Owner: fabioricali
- Created: 2017-08-22T09:50:13.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-02-27T18:40:56.000Z (over 3 years ago)
- Last Synced: 2025-01-14T19:00:40.548Z (over 1 year ago)
- Topics: checks, javascript, object, types
- Language: JavaScript
- Size: 90.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
## 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