ee-types
Reliabale type detection
API
var type = require('ee-types');
type.string('nope'); // true
type.strign(new String('yeah')); // true
type.s('michael'); // true
type(2) // number
API
type() // returns the loawercase type
type.string()
type.number()
type.boolean()
type.function()
type.object()
type.date()
type.error()
type.regexp()
type.array()
type.buffer()
type.null()
type.undefined()
type.symbol()
shortcut methods
type.s() // string
type.n() // number
type.b() // boolean
type.u() // undefined
check array and their contents. for every type above there is an array method like the one below.
type.stringArray([ 'hi', new String('name'), 'is', 'michael' ]) // true
type.sa([ 'hi', new String('name'), 'is', 'michael' ]) // true