Mohammad Asif cf937194cb Removed un-waned things 1. | vor 6 Monaten | |
---|---|---|
.. | ||
.github | vor 6 Monaten | |
test | vor 6 Monaten | |
.eslintignore | vor 6 Monaten | |
.eslintrc | vor 6 Monaten | |
.nycrc | vor 6 Monaten | |
CHANGELOG.md | vor 6 Monaten | |
LICENSE | vor 6 Monaten | |
README.md | vor 6 Monaten | |
auto.js | vor 6 Monaten | |
implementation.js | vor 6 Monaten | |
index.js | vor 6 Monaten | |
package.json | vor 6 Monaten | |
polyfill.js | vor 6 Monaten | |
shim.js | vor 6 Monaten |
ES2015-compliant shim for Number.isNaN - the global isNaN returns false positives.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.
Number.isNaN = require('is-nan');
var assert = require('assert');
assert.notOk(Number.isNaN(undefined));
assert.notOk(Number.isNaN(null));
assert.notOk(Number.isNaN(false));
assert.notOk(Number.isNaN(true));
assert.notOk(Number.isNaN(0));
assert.notOk(Number.isNaN(42));
assert.notOk(Number.isNaN(Infinity));
assert.notOk(Number.isNaN(-Infinity));
assert.notOk(Number.isNaN('foo'));
assert.notOk(Number.isNaN(function () {}));
assert.notOk(Number.isNaN([]));
assert.notOk(Number.isNaN({}));
assert.ok(Number.isNaN(NaN));
Simply clone the repo, npm install
, and run npm test