Socket
Book a DemoInstallSign in
Socket

number.isnan

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

number.isnan

ES2015-compliant shim for Number.isNaN - the global isNaN returns false positives.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
247
233.78%
Maintainers
2
Weekly downloads
 
Created
Source

number.isnan Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

ES2015-compliant shim for Number.isNaN.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.

Example

Number.isNaN = require('number.isnan');
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

Keywords

is

FAQs

Package last updated on 28 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts