pax_global_header00006660000000000000000000000064137710251530014516gustar00rootroot0000000000000052 comment=6a83a0a7d12cdd1a10933b5b32e5d9acb57297cc is-nan-1.3.2/000077500000000000000000000000001377102515300127065ustar00rootroot00000000000000is-nan-1.3.2/.eslintignore000066400000000000000000000000121377102515300154020ustar00rootroot00000000000000coverage/ is-nan-1.3.2/.eslintrc000066400000000000000000000000531377102515300145300ustar00rootroot00000000000000{ "root": true, "extends": "@ljharb", } is-nan-1.3.2/.github/000077500000000000000000000000001377102515300142465ustar00rootroot00000000000000is-nan-1.3.2/.github/FUNDING.yml000066400000000000000000000011011377102515300160540ustar00rootroot00000000000000# These are supported funding model platforms github: [ljharb] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username tidelift: npm/is-nan community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] is-nan-1.3.2/.github/workflows/000077500000000000000000000000001377102515300163035ustar00rootroot00000000000000is-nan-1.3.2/.github/workflows/node-4+.yml000066400000000000000000000024501377102515300201700ustar00rootroot00000000000000name: 'Tests: node.js' on: [pull_request, push] jobs: matrix: runs-on: ubuntu-latest outputs: latest: ${{ steps.set-matrix.outputs.requireds }} minors: ${{ steps.set-matrix.outputs.optionals }} steps: - uses: ljharb/actions/node/matrix@main id: set-matrix with: preset: '>=4' latest: needs: [matrix] name: 'latest minors' runs-on: ubuntu-latest strategy: matrix: ${{ fromJson(needs.matrix.outputs.latest) }} steps: - uses: actions/checkout@v2 - uses: ljharb/actions/node/run@main name: 'npm install && npm run tests-only' with: node-version: ${{ matrix.node-version }} command: 'tests-only' minors: needs: [matrix, latest] name: 'non-latest minors' continue-on-error: true if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }} runs-on: ubuntu-latest strategy: matrix: ${{ fromJson(needs.matrix.outputs.minors) }} steps: - uses: actions/checkout@v2 - uses: ljharb/actions/node/run@main with: node-version: ${{ matrix.node-version }} command: 'tests-only' node: name: 'node 4+' needs: [latest, minors] runs-on: ubuntu-latest steps: - run: 'echo tests completed' is-nan-1.3.2/.github/workflows/node-iojs.yml000066400000000000000000000026361377102515300207240ustar00rootroot00000000000000name: 'Tests: node.js (io.js)' on: [pull_request, push] jobs: matrix: runs-on: ubuntu-latest outputs: latest: ${{ steps.set-matrix.outputs.requireds }} minors: ${{ steps.set-matrix.outputs.optionals }} steps: - uses: ljharb/actions/node/matrix@main id: set-matrix with: preset: 'iojs' latest: needs: [matrix] name: 'latest minors' runs-on: ubuntu-latest strategy: matrix: ${{ fromJson(needs.matrix.outputs.latest) }} steps: - uses: actions/checkout@v2 - uses: ljharb/actions/node/run@main name: 'npm install && npm run tests-only' with: node-version: ${{ matrix.node-version }} command: 'tests-only' skip-ls-check: true minors: needs: [matrix, latest] name: 'non-latest minors' continue-on-error: true if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }} runs-on: ubuntu-latest strategy: matrix: ${{ fromJson(needs.matrix.outputs.minors) }} steps: - uses: actions/checkout@v2 - uses: ljharb/actions/node/run@main name: 'npm install && npm run tests-only' with: node-version: ${{ matrix.node-version }} command: 'tests-only' skip-ls-check: true node: name: 'io.js' needs: [latest, minors] runs-on: ubuntu-latest steps: - run: 'echo tests completed' is-nan-1.3.2/.github/workflows/node-pretest.yml000066400000000000000000000010671377102515300214430ustar00rootroot00000000000000name: 'Tests: pretest/posttest' on: [pull_request, push] jobs: pretest: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ljharb/actions/node/run@main name: 'npm install && npm run pretest' with: node-version: 'lts/*' command: 'pretest' posttest: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ljharb/actions/node/run@main name: 'npm install && npm run posttest' with: node-version: 'lts/*' command: 'posttest' is-nan-1.3.2/.github/workflows/node-zero.yml000066400000000000000000000030401377102515300207250ustar00rootroot00000000000000name: 'Tests: node.js (0.x)' on: [pull_request, push] jobs: matrix: runs-on: ubuntu-latest outputs: stable: ${{ steps.set-matrix.outputs.requireds }} unstable: ${{ steps.set-matrix.outputs.optionals }} steps: - uses: ljharb/actions/node/matrix@main id: set-matrix with: preset: '0.x' stable: needs: [matrix] name: 'stable minors' runs-on: ubuntu-latest strategy: matrix: ${{ fromJson(needs.matrix.outputs.stable) }} steps: - uses: actions/checkout@v2 - uses: ljharb/actions/node/run@main with: node-version: ${{ matrix.node-version }} command: 'tests-only' cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }} skip-ls-check: true unstable: needs: [matrix, stable] name: 'unstable minors' continue-on-error: true if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }} runs-on: ubuntu-latest strategy: matrix: ${{ fromJson(needs.matrix.outputs.unstable) }} steps: - uses: actions/checkout@v2 - uses: ljharb/actions/node/run@main with: node-version: ${{ matrix.node-version }} command: 'tests-only' cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }} skip-ls-check: true node: name: 'node 0.x' needs: [stable, unstable] runs-on: ubuntu-latest steps: - run: 'echo tests completed' is-nan-1.3.2/.github/workflows/rebase.yml000066400000000000000000000004011377102515300202620ustar00rootroot00000000000000name: Automatic Rebase on: [pull_request_target] jobs: _: name: "Automatic Rebase" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ljharb/rebase@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} is-nan-1.3.2/.github/workflows/require-allow-edits.yml000066400000000000000000000003011377102515300227160ustar00rootroot00000000000000name: Require “Allow Edits” on: [pull_request_target] jobs: _: name: "Require “Allow Edits”" runs-on: ubuntu-latest steps: - uses: ljharb/require-allow-edits@main is-nan-1.3.2/.gitignore000066400000000000000000000003301377102515300146720ustar00rootroot00000000000000# gitignore lib-cov *.seed *.log *.csv *.dat *.out *.pid *.gz pids logs results npm-debug.log node_modules # Only apps should have lockfiles npm-shrinkwrap.json package-lock.json yarn.lock coverage/ .nyc_output/ is-nan-1.3.2/.npmignore000066400000000000000000000003531377102515300147060ustar00rootroot00000000000000# gitignore lib-cov *.seed *.log *.csv *.dat *.out *.pid *.gz pids logs results npm-debug.log node_modules # Only apps should have lockfiles npm-shrinkwrap.json package-lock.json yarn.lock coverage/ .nyc_output/ .github/workflows is-nan-1.3.2/.npmrc000066400000000000000000000000231377102515300140210ustar00rootroot00000000000000package-lock=false is-nan-1.3.2/.nycrc000066400000000000000000000003301377102515300140210ustar00rootroot00000000000000{ "all": true, "check-coverage": false, "reporter": ["text-summary", "text", "html", "json"], "lines": 86, "statements": 85.93, "functions": 82.43, "branches": 76.06, "exclude": [ "coverage", "test" ] } is-nan-1.3.2/CHANGELOG.md000066400000000000000000000036601377102515300145240ustar00rootroot000000000000001.3.2 / 2020-12-23 ================= * [meta] do not publish github action workflow files 1.3.1 / 2020-12-23 ================= * [Fix] avoid mutating `Number.isNaN` when present * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `es5-shim`, `tape`, `functions-have-names`; add `safe-publish-latest` * [readme] fix repo URLs, remove defunct badges * [Tests] migrate tests to Github Actions * [Tests] add `implementation` est; run `es-shim-api` in postlint; use `tape` runner * [actions] add "Allow Edits" workflow * [actions] switch Automatic Rebase workflow to `pull_request_target` event 1.3.0 / 2019-12-15 ================= * [New] add "auto" entry point * [readme] fix repo URLs * [docs] clean up README links/formatting * [Deps] update `define-properties` * [meta] add `funding` field; FUNDING.yml * [meta] Only apps should have lockfiles * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `es5-shim`, `tape`, `@es-shims/api` * [Tests] use shared travis-ci configs * [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops * [Tests] use `functions-have-names` * [Tests] remove `jscs` * [actions] add automatic rebasing / merge commit blocking 1.2.1 / 2015-08-16 ================= * [Docs] Update readme 1.2.0 / 2015-08-16 ================= * [New] Implement the [es-shim API](es-shims/api) interface * [Dev Deps] update `eslint`, `tape`, `es5-shim`, `@ljharb/eslint-config` * [Tests] up to `io.js` `v3.0` * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG * [Security] Add `npm run security` 1.1.0 / 2015-06-24 ================= * Add a "shim" method * Add `npm run eslint` * Test latest `node` and `io.js` on `travis-ci` * Add license and download badges to README * Update `tape`, `covert`, `jscs` 1.0.1 / 2014-07-05 ================= * Oops, jscs should be a devDependency 1.0.0 / 2014-07-05 ================= * Initial release. is-nan-1.3.2/LICENSE000066400000000000000000000020711377102515300137130ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2014 Jordan Harband Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. is-nan-1.3.2/README.md000066400000000000000000000032501377102515300141650ustar00rootroot00000000000000# is-nan [![Version Badge][2]][1] [![dependency status][5]][6] [![dev dependency status][7]][8] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][11]][1] ES2015-compliant shim for Number.isNaN - the global isNaN returns false positives. This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan). ## Example ```js 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` [1]: https://npmjs.org/package/is-nan [2]: https://versionbadg.es/es-shims/is-nan.svg [5]: https://david-dm.org/es-shims/is-nan.svg [6]: https://david-dm.org/es-shims/is-nan [7]: https://david-dm.org/es-shims/is-nan/dev-status.svg [8]: https://david-dm.org/es-shims/is-nan#info=devDependencies [11]: https://nodei.co/npm/is-nan.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/is-nan.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/is-nan.svg [downloads-url]: https://npm-stat.com/charts.html?package=is-nan is-nan-1.3.2/auto.js000066400000000000000000000000441377102515300142120ustar00rootroot00000000000000'use strict'; require('./shim')(); is-nan-1.3.2/implementation.js000066400000000000000000000002341377102515300162700ustar00rootroot00000000000000'use strict'; /* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function isNaN(value) { return value !== value; }; is-nan-1.3.2/index.js000066400000000000000000000007161377102515300143570ustar00rootroot00000000000000'use strict'; var callBind = require('call-bind'); var define = require('define-properties'); var implementation = require('./implementation'); var getPolyfill = require('./polyfill'); var shim = require('./shim'); var polyfill = callBind(getPolyfill(), Number); /* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ define(polyfill, { getPolyfill: getPolyfill, implementation: implementation, shim: shim }); module.exports = polyfill; is-nan-1.3.2/package.json000066400000000000000000000031711377102515300151760ustar00rootroot00000000000000{ "name": "is-nan", "version": "1.3.2", "description": "ES2015-compliant shim for Number.isNaN - the global isNaN returns false positives.", "author": "Jordan Harband", "funding": { "url": "https://github.com/sponsors/ljharb" }, "license": "MIT", "main": "index.js", "scripts": { "prepublish": "safe-publish-latest", "pretest": "npm run lint", "test": "npm run tests-only", "tests-only": "nyc tape 'test/**/*.js'", "posttest": "npx aud --production", "lint": "eslint .", "postlint": "es-shim-api --bound" }, "repository": { "type": "git", "url": "git://github.com/es-shims/is-nan.git" }, "bugs": { "url": "https://github.com/es-shims/is-nan/issues" }, "homepage": "https://github.com/es-shims/is-nan", "keywords": [ "is", "NaN", "not a number", "number", "isNaN", "ES6", "ES2015", "shim", "polyfill", "es-shim API" ], "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" }, "devDependencies": { "@es-shims/api": "^2.1.2", "@ljharb/eslint-config": "^17.3.0", "aud": "^1.1.3", "es5-shim": "^4.5.14", "eslint": "^7.16.0", "functions-have-names": "^1.2.2", "nyc": "^10.3.2", "safe-publish-latest": "^1.1.4", "tape": "^5.0.1" }, "testling": { "files": "test.js", "browsers": [ "iexplore/6.0..latest", "firefox/3.0..6.0", "firefox/15.0..latest", "firefox/nightly", "chrome/4.0..10.0", "chrome/20.0..latest", "chrome/canary", "opera/10.0..12.0", "opera/15.0..latest", "opera/next", "safari/4.0..latest", "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2" ] }, "engines": { "node": ">= 0.4" } } is-nan-1.3.2/polyfill.js000066400000000000000000000003411377102515300150740ustar00rootroot00000000000000'use strict'; var implementation = require('./implementation'); module.exports = function getPolyfill() { if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) { return Number.isNaN; } return implementation; }; is-nan-1.3.2/shim.js000066400000000000000000000006031377102515300142030ustar00rootroot00000000000000'use strict'; var define = require('define-properties'); var getPolyfill = require('./polyfill'); /* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function shimNumberIsNaN() { var polyfill = getPolyfill(); define(Number, { isNaN: polyfill }, { isNaN: function testIsNaN() { return Number.isNaN !== polyfill; } }); return polyfill; }; is-nan-1.3.2/test/000077500000000000000000000000001377102515300136655ustar00rootroot00000000000000is-nan-1.3.2/test/index.js000066400000000000000000000003001377102515300153230ustar00rootroot00000000000000'use strict'; var numberIsNaN = require('../'); var test = require('tape'); var runTests = require('./tests'); test('as a function', function (t) { runTests(numberIsNaN, t); t.end(); }); is-nan-1.3.2/test/shimmed.js000066400000000000000000000014761377102515300156610ustar00rootroot00000000000000'use strict'; require('es5-shim'); var numberIsNaN = require('../'); numberIsNaN.shim(); var test = require('tape'); var defineProperties = require('define-properties'); var isEnumerable = Object.prototype.propertyIsEnumerable; var functionsHaveNames = require('functions-have-names')(); var runTests = require('./tests'); test('shimmed', function (t) { t.equal(Number.isNaN.length, 1, 'Number.isNaN has a length of 1'); t.test('Function name', { skip: !functionsHaveNames }, function (st) { st.equal(Number.isNaN.name, 'isNaN', 'Number.isNaN has name "isNaN"'); st.end(); }); t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { et.equal(false, isEnumerable.call(Number, 'isNaN'), 'Number.isNaN is not enumerable'); et.end(); }); runTests(Number.isNaN, t); t.end(); }); is-nan-1.3.2/test/tests.js000066400000000000000000000023271377102515300153710ustar00rootroot00000000000000'use strict'; module.exports = function (numberIsNaN, t) { t.test('not NaN', function (st) { st.test('primitives', function (sst) { sst.notOk(numberIsNaN(), 'undefined is not NaN'); sst.notOk(numberIsNaN(null), 'null is not NaN'); sst.notOk(numberIsNaN(false), 'false is not NaN'); sst.notOk(numberIsNaN(true), 'true is not NaN'); sst.notOk(numberIsNaN(0), 'positive zero is not NaN'); sst.notOk(numberIsNaN(Infinity), 'Infinity is not NaN'); sst.notOk(numberIsNaN(-Infinity), '-Infinity is not NaN'); sst.notOk(numberIsNaN('foo'), 'string is not NaN'); sst.notOk(numberIsNaN('NaN'), 'string NaN is not NaN'); sst.end(); }); st.notOk(numberIsNaN([]), 'array is not NaN'); st.notOk(numberIsNaN({}), 'object is not NaN'); st.notOk(numberIsNaN(function () {}), 'function is not NaN'); st.test('valueOf', function (vt) { var obj = { valueOf: function () { return NaN; } }; vt.ok(numberIsNaN(Number(obj)), 'object with valueOf of NaN, converted to Number, is NaN'); vt.notOk(numberIsNaN(obj), 'object with valueOf of NaN is not NaN'); vt.end(); }); st.end(); }); t.test('NaN literal', function (st) { st.ok(numberIsNaN(NaN), 'NaN is NaN'); st.end(); }); };