diff options
Diffstat (limited to 'src/node_modules/is-nan')
-rw-r--r-- | src/node_modules/is-nan/.eslintrc | 5 | ||||
-rw-r--r-- | src/node_modules/is-nan/.github/FUNDING.yml | 12 | ||||
-rw-r--r-- | src/node_modules/is-nan/.github/workflows/rebase.yml | 15 | ||||
-rw-r--r-- | src/node_modules/is-nan/.travis.yml | 12 | ||||
-rw-r--r-- | src/node_modules/is-nan/CHANGELOG.md | 42 | ||||
-rw-r--r-- | src/node_modules/is-nan/LICENSE | 20 | ||||
-rw-r--r-- | src/node_modules/is-nan/README.md | 52 | ||||
-rw-r--r-- | src/node_modules/is-nan/auto.js | 3 | ||||
-rw-r--r-- | src/node_modules/is-nan/implementation.js | 7 | ||||
-rw-r--r-- | src/node_modules/is-nan/index.js | 19 | ||||
-rw-r--r-- | src/node_modules/is-nan/package.json | 75 | ||||
-rw-r--r-- | src/node_modules/is-nan/polyfill.js | 10 | ||||
-rw-r--r-- | src/node_modules/is-nan/shim.js | 16 | ||||
-rw-r--r-- | src/node_modules/is-nan/test/index.js | 11 | ||||
-rw-r--r-- | src/node_modules/is-nan/test/shimmed.js | 30 | ||||
-rw-r--r-- | src/node_modules/is-nan/test/tests.js | 40 |
16 files changed, 369 insertions, 0 deletions
diff --git a/src/node_modules/is-nan/.eslintrc b/src/node_modules/is-nan/.eslintrc new file mode 100644 index 0000000..3b5d9e9 --- /dev/null +++ b/src/node_modules/is-nan/.eslintrc @@ -0,0 +1,5 @@ +{ + "root": true, + + "extends": "@ljharb", +} diff --git a/src/node_modules/is-nan/.github/FUNDING.yml b/src/node_modules/is-nan/.github/FUNDING.yml new file mode 100644 index 0000000..0b42d4a --- /dev/null +++ b/src/node_modules/is-nan/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# 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'] diff --git a/src/node_modules/is-nan/.github/workflows/rebase.yml b/src/node_modules/is-nan/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/src/node_modules/is-nan/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/node_modules/is-nan/.travis.yml b/src/node_modules/is-nan/.travis.yml new file mode 100644 index 0000000..2d1c1d2 --- /dev/null +++ b/src/node_modules/is-nan/.travis.yml @@ -0,0 +1,12 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/src/node_modules/is-nan/CHANGELOG.md b/src/node_modules/is-nan/CHANGELOG.md new file mode 100644 index 0000000..c906867 --- /dev/null +++ b/src/node_modules/is-nan/CHANGELOG.md @@ -0,0 +1,42 @@ +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. diff --git a/src/node_modules/is-nan/LICENSE b/src/node_modules/is-nan/LICENSE new file mode 100644 index 0000000..47b7b50 --- /dev/null +++ b/src/node_modules/is-nan/LICENSE @@ -0,0 +1,20 @@ +The 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. diff --git a/src/node_modules/is-nan/README.md b/src/node_modules/is-nan/README.md new file mode 100644 index 0000000..d53b67e --- /dev/null +++ b/src/node_modules/is-nan/README.md @@ -0,0 +1,52 @@ +# is-nan <sup>[![Version Badge][2]][1]</sup> + +[![Build Status][3]][4] +[![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]: http://versionbadg.es/es-shims/is-nan.svg +[3]: https://travis-ci.org/es-shims/is-nan.svg +[4]: https://travis-ci.org/es-shims/is-nan +[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]: http://img.shields.io/npm/l/is-nan.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/is-nan.svg +[downloads-url]: http://npm-stat.com/charts.html?package=is-nan diff --git a/src/node_modules/is-nan/auto.js b/src/node_modules/is-nan/auto.js new file mode 100644 index 0000000..8ebf606 --- /dev/null +++ b/src/node_modules/is-nan/auto.js @@ -0,0 +1,3 @@ +'use strict'; + +require('./shim')(); diff --git a/src/node_modules/is-nan/implementation.js b/src/node_modules/is-nan/implementation.js new file mode 100644 index 0000000..6200b6b --- /dev/null +++ b/src/node_modules/is-nan/implementation.js @@ -0,0 +1,7 @@ +'use strict'; + +/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ + +module.exports = function isNaN(value) { + return value !== value; +}; diff --git a/src/node_modules/is-nan/index.js b/src/node_modules/is-nan/index.js new file mode 100644 index 0000000..709ed0d --- /dev/null +++ b/src/node_modules/is-nan/index.js @@ -0,0 +1,19 @@ +'use strict'; + +var define = require('define-properties'); + +var implementation = require('./implementation'); +var getPolyfill = require('./polyfill'); +var shim = require('./shim'); + +var polyfill = getPolyfill(); + +/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ + +define(polyfill, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = polyfill; diff --git a/src/node_modules/is-nan/package.json b/src/node_modules/is-nan/package.json new file mode 100644 index 0000000..16c0823 --- /dev/null +++ b/src/node_modules/is-nan/package.json @@ -0,0 +1,75 @@ +{ + "name": "is-nan", + "version": "1.3.0", + "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": { + "pretest": "npm run lint && es-shim-api", + "test": "npm run tests-only", + "tests-only": "npm run test:function && npm run --silent test:shimmed", + "test:function": "node test/index", + "test:shimmed": "node test/shimmed", + "posttest": "npx aud", + "coverage": "covert test/*.js", + "lint": "eslint ." + }, + "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": { + "define-properties": "^1.1.3" + }, + "devDependencies": { + "@es-shims/api": "^2.1.2", + "@ljharb/eslint-config": "^15.0.2", + "covert": "^1.1.1", + "es5-shim": "^4.5.13", + "eslint": "^6.7.2", + "functions-have-names": "^1.2.0", + "tape": "^4.11.0" + }, + "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" + } +} diff --git a/src/node_modules/is-nan/polyfill.js b/src/node_modules/is-nan/polyfill.js new file mode 100644 index 0000000..2fa5886 --- /dev/null +++ b/src/node_modules/is-nan/polyfill.js @@ -0,0 +1,10 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = function getPolyfill() { + if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) { + return Number.isNaN; + } + return implementation; +}; diff --git a/src/node_modules/is-nan/shim.js b/src/node_modules/is-nan/shim.js new file mode 100644 index 0000000..05dbaf9 --- /dev/null +++ b/src/node_modules/is-nan/shim.js @@ -0,0 +1,16 @@ +'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; +}; diff --git a/src/node_modules/is-nan/test/index.js b/src/node_modules/is-nan/test/index.js new file mode 100644 index 0000000..f55aba9 --- /dev/null +++ b/src/node_modules/is-nan/test/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var numberIsNaN = require('../'); +var test = require('tape'); +var runTests = require('./tests'); + +test('as a function', function (t) { + runTests(numberIsNaN, t); + + t.end(); +}); diff --git a/src/node_modules/is-nan/test/shimmed.js b/src/node_modules/is-nan/test/shimmed.js new file mode 100644 index 0000000..66a5400 --- /dev/null +++ b/src/node_modules/is-nan/test/shimmed.js @@ -0,0 +1,30 @@ +'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(); +}); diff --git a/src/node_modules/is-nan/test/tests.js b/src/node_modules/is-nan/test/tests.js new file mode 100644 index 0000000..cd6a500 --- /dev/null +++ b/src/node_modules/is-nan/test/tests.js @@ -0,0 +1,40 @@ +'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(); + }); +}; |