cletus/node_modules/is-nan
2025-05-09 15:53:19 -05:00
..
.github Initial commit 2025-05-09 15:53:19 -05:00
test Initial commit 2025-05-09 15:53:19 -05:00
.eslintignore Initial commit 2025-05-09 15:53:19 -05:00
.eslintrc Initial commit 2025-05-09 15:53:19 -05:00
.nycrc Initial commit 2025-05-09 15:53:19 -05:00
auto.js Initial commit 2025-05-09 15:53:19 -05:00
CHANGELOG.md Initial commit 2025-05-09 15:53:19 -05:00
implementation.js Initial commit 2025-05-09 15:53:19 -05:00
index.js Initial commit 2025-05-09 15:53:19 -05:00
LICENSE Initial commit 2025-05-09 15:53:19 -05:00
package.json Initial commit 2025-05-09 15:53:19 -05:00
polyfill.js Initial commit 2025-05-09 15:53:19 -05:00
README.md Initial commit 2025-05-09 15:53:19 -05:00
shim.js Initial commit 2025-05-09 15:53:19 -05:00

is-nan Version Badge

dependency status dev dependency status License Downloads

npm badge

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.

Example

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));

Tests

Simply clone the repo, npm install, and run npm test