Type checking made easy.
is.js can be used to mitigate type checking inconsistencies until JavaScript provides a reliable way to do the same natively.
It is quite self-descriptif and convenient. For example, instead of:
if (obj && typeof obj === 'object') { ... }
you can write a more intuitive:
if (is.object(obj)) { ... }
npm install git://github.com/olegskl/is.git
or in package.json as a dependency:
"dependencies": {
"is": "git://github.com/olegskl/is.git"
}
is.array();
is.null();
is.undefined();
is.defined();
is.function();
is.nan();
is.number();
is.string();
is.boolean();
is.object();