root 7621d6d22a 221005-1449-Kim | 2 年之前 | |
---|---|---|
.. | ||
.github | 2 年之前 | |
test | 2 年之前 | |
.eslintignore | 2 年之前 | |
.eslintrc | 2 年之前 | |
.nycrc | 2 年之前 | |
CHANGELOG.md | 2 年之前 | |
LICENSE | 2 年之前 | |
README.md | 2 年之前 | |
auto.js | 2 年之前 | |
implementation.js | 2 年之前 | |
index.js | 2 年之前 | |
package.json | 2 年之前 | |
polyfill.js | 2 年之前 | |
shim.js | 2 年之前 |
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