@jkroso/type

less broken typeof

Stats

StarsIssuesVersionUpdatedCreatedSize
@jkroso/type
302.0.05 years ago6 years agoMinified + gzip package size for @jkroso/type in KB

Readme

type

Type assertions aka less-broken typeof.

API

var type = require('type')
type(new Date) // => 'date'
type({}) // => 'object'
type(null) // => 'null'
type(undefined) // => 'undefined'
type("hey") // => 'string'
type(true) // => 'boolean'
type(false) // => 'boolean'
type(12) // => 'number'
type(type) // => 'function'
type(/asdf/) // => 'regexp'
type((function(){ return arguments })()) // => 'arguments'
type([]) // => 'array'
type(new Uint8Array) // => 'bit-array'
type(document.createElement('div')) // => 'element'

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.