urbanu619 e168f54beb first commit 10 ay önce
..
.github e168f54beb first commit 10 ay önce
test e168f54beb first commit 10 ay önce
.eslintrc e168f54beb first commit 10 ay önce
.travis.yml e168f54beb first commit 10 ay önce
CHANGELOG.md e168f54beb first commit 10 ay önce
LICENSE e168f54beb first commit 10 ay önce
README.md e168f54beb first commit 10 ay önce
auto.js e168f54beb first commit 10 ay önce
implementation.js e168f54beb first commit 10 ay önce
index.js e168f54beb first commit 10 ay önce
package.json e168f54beb first commit 10 ay önce
polyfill.js e168f54beb first commit 10 ay önce
shim.js e168f54beb first commit 10 ay önce

README.md

is-nan Version Badge

Build Status 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