@jkroso/type
less broken typeof
Last updated 10 years ago by jkroso .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @jkroso/type 
SYNC missed versions from official npm registry.

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'

Current Tags

  • 2.0.0                                ...           latest (10 years ago)

2 Versions

  • 2.0.0                                ...           10 years ago
  • 1.1.1                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (7)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |