typical
For type-checking Javascript values.
Example
var t = require("typical");
t.isNumber(n) ⇒ boolean
Returns true if input is a number
Kind: static method of typical
Param | Type | Description |
---|
n | * | the input to test |
Example
> t.isNumber(0)
true
> t.isNumber(1)
true
> t.isNumber(1.1)
true
> t.isNumber(0xff)
true
> t.isNumber(0644)
true
> t.isNumber(6.2e5)
true
> t.isNumber(NaN)
false
> t.isNumber(Infinity)
false
t.isPlainObject(input) ⇒ boolean
Returns true if input typeof
is object
and directly decends from Object
(and not Array
, RegExp
etc.)
Kind: static method of typical
Param | Type | Description |
---|
input | * | the input to test |
Example
> t.isPlainObject({ clive: "hater" })
true
> t.isPlainObject(new Date())
false
> t.isPlainObject([ 0, 1 ])
false
> t.isPlainObject(1)
false
> t.isPlainObject(/test/)
false
© 2015 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.