0.0.5 ā€¢ Published 4 years ago

native-type v0.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Use this package to detect object class or native type in JavaScript.

šŸ  Homepage

Install

npm install native-type

Usage

const getNativeType = require("native-type");

getNativeType(""); // ==> 'string'
getNativeType(123); // ==> 'number'
getNativeType({}); // ==> 'object'
getNativeType([]); // ==> 'array'
getNativeType(undefined); // ==> 'undefined'
getNativeType(new Date()); // ==> 'date'
getNativeType(new Map()); // ==> 'map'
getNativeType(new Set()); // ==> 'set'
getNativeType(new Promise(() => {})); // ==> 'promise'
getNativeType(null); // ==> 'null'
getNativeType(9n); // ==> 'bigint'
getNativeType(Symbol) // ==> function
getNativeType(() => {}), // ==> "function"
getNativeType(Symbol.iterator // ==> symbol

More examples here

Run tests

npm run test

Author

šŸ‘¤ Tabrez Khan (https://github.com/iamtabrezkhan)

šŸ¤ Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ā­ļø if this project helped you!

šŸ“ License

Copyright Ā© 2020 Tabrez Khan (https://github.com/iamtabrezkhan). This project is MIT licensed.


This README was generated with ā¤ļø by readme-md-generator