Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

number.isnan

es-shims473MIT1.0.0

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

is, NaN, not a number, number, isNaN, ES6, ES2015, shim, polyfill, es-shim API

readme

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

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.0.0 - 2022-06-27

Commits

  • [Breaking] migrate package to match is-nan 1.x 71f4c0c
  • [meta] add auto-changelog 60e73b8
  • [meta] use npmignore to autogenerate an npmignore file 8a78b9a

v0.1.1 - 2015-08-19

Fixed

  • Fix typo in reference. Closes #1. #1

Commits

v0.1.0 - 2014-05-21

Commits