type-component
Cross-browser type assertions (less broken typeof)
Last updated 12 years ago .
Original npm · Tarball · package.json
$ gnpm install type-component 
SYNC missed versions from official npm registry.

type

Type assertions aka less-broken typeof.

Example

var type = require('type');

var obj = new Date;
if (type(obj) == 'date') ...

API

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'

License

MIT

Current Tags

  • 0.0.1                                ...           latest (12 years ago)

1 Versions

  • 0.0.1                                ...           12 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |