1.0.0 • Published 6 years ago

ez-type v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

ez-type

Easily determine type.

Install

npm install ez-type

Usage

const ezType = require('ez-type')
ezType({}) //"object"
ezType([]) //"array"
ezType(null) //"null"
ezType(undefined) //"undefined"
ezType(NaN) //"NaN"
ezType(5)  //"number"
ezType("hewwo") //"string"

//avoid common type pitfalls
typeof [] //"object"
typeof null //"object"
typeof NaN //"number"