-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Breaking] migrate package to match
is-nan
1.x
- Loading branch information
Showing
29 changed files
with
406 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"root": true, | ||
|
||
"extends": "@ljharb", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/number.isnan | ||
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'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: 'Tests: node.js < 10' | ||
|
||
on: [pull_request, push] | ||
|
||
jobs: | ||
tests: | ||
uses: ljharb/actions/.github/workflows/node.yml@main | ||
with: | ||
range: '< 10' | ||
type: minors | ||
command: npm run tests-only | ||
|
||
node: | ||
name: 'node < 10' | ||
needs: [tests] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo tests completed' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: 'Tests: pretest/posttest' | ||
|
||
on: [pull_request, push] | ||
|
||
jobs: | ||
tests: | ||
uses: ljharb/actions/.github/workflows/pretest.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: 'Tests: node.js >= 10' | ||
|
||
on: [pull_request, push] | ||
|
||
jobs: | ||
tests: | ||
uses: ljharb/actions/.github/workflows/node.yml@main | ||
with: | ||
range: '>= 10' | ||
type: minors | ||
command: npm run tests-only | ||
|
||
node: | ||
name: 'node >= 10' | ||
needs: [tests] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo tests completed' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Require “Allow Edits” | ||
|
||
on: [pull_request_target] | ||
|
||
jobs: | ||
_: | ||
name: "Require “Allow Edits”" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: ljharb/require-allow-edits@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,24 @@ | ||
.DS_Store | ||
node_modules/ | ||
# 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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
.DS_Store | ||
node_modules/ | ||
test/ | ||
.travis.yml | ||
testling.html | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"all": true, | ||
"check-coverage": false, | ||
"reporter": ["text-summary", "text", "html", "json"], | ||
"exclude": [ | ||
"coverage", | ||
"test" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,55 @@ | ||
# ES6 `Number.isNaN` polyfill | ||
# number.isnan <sup>[![Version Badge][npm-version-svg]][package-url]</sup> | ||
|
||
[![Build status](https://travis-ci.org/leonderijke/Number.isNaN.svg?branch=master)](https://travis-ci.org/leonderijke/Number.isNaN) | ||
[![Dependency Status](https://david-dm.org/leonderijke/Number.isNaN.svg?theme=shields.io)](https://david-dm.org/leonderijke/Number.isNaN) | ||
[![devDependency Status](https://david-dm.org/leonderijke/Number.isNaN/dev-status.svg?theme=shields.io)](https://david-dm.org/leonderijke/Number.isNaN#info=devDependencies) | ||
[![browser support](https://ci.testling.com/leonderijke/Number.isNaN.png) | ||
](https://ci.testling.com/leonderijke/Number.isNaN) | ||
[![github actions][actions-image]][actions-url] | ||
[![coverage][codecov-image]][codecov-url] | ||
[![dependency status][deps-svg]][deps-url] | ||
[![dev dependency status][dev-deps-svg]][dev-deps-url] | ||
[![License][license-image]][license-url] | ||
[![Downloads][downloads-image]][downloads-url] | ||
|
||
A polyfill for [the `Number.isNaN` method in ECMAScript 6](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan). | ||
[![npm badge][npm-badge-png]][package-url] | ||
|
||
Other polyfills for `Number.isNaN` are available: | ||
ES2015-compliant shim for Number.isNaN. | ||
|
||
* <https://github.com/ljharb/is-nan> by [Jordan Harband](https://twitter.com/ljharb) | ||
* <https://github.com/paulmillr/es6-shim/blob/0.10.1/es6-shim.js#L726-L733> by [Paul Miller](http://paulmillr.com/) | ||
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](https://tc39.es/ecma262/#sec-number.isnan). | ||
|
||
## Installation | ||
|
||
Via [bower](http://bower.io/): | ||
|
||
```bash | ||
bower install Number.isNaN | ||
``` | ||
|
||
Then, in a browser: | ||
|
||
```html | ||
<script src="bower_components/Number.isNaN/isnan.js"></script> | ||
``` | ||
|
||
Via [npm](http://npmjs.org/): | ||
|
||
```bash | ||
npm install number.isnan | ||
``` | ||
|
||
Then, in [Node.js](http://nodejs.org/): | ||
## Example | ||
|
||
```js | ||
require('number.isnan'); | ||
|
||
// On Windows and on Mac systems with default settings, case doesn’t matter, | ||
// which allows you to do this instead: | ||
require('Number.isNaN'); | ||
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)); | ||
``` | ||
|
||
## Relevant links | ||
|
||
Find more information about `Number.isNaN` here: | ||
|
||
* https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan | ||
* http://wiki.ecmascript.org/doku.php?id=harmony:number.isnan | ||
* http://ariya.ofilabs.com/2014/05/the-curious-case-of-javascript-nan.html | ||
* http://www.2ality.com/2012/02/nan-infinity.html | ||
|
||
## License | ||
|
||
MIT License | ||
## Tests | ||
Simply clone the repo, `npm install`, and run `npm test` | ||
|
||
[package-url]: https://npmjs.org/package/number.isnan | ||
[npm-version-svg]: https://versionbadg.es/es-shims/number.isnan.svg | ||
[deps-svg]: https://david-dm.org/es-shims/Number.isNaN.svg | ||
[deps-url]: https://david-dm.org/es-shims/Number.isNaN | ||
[dev-deps-svg]: https://david-dm.org/es-shims/Number.isNaN/dev-status.svg | ||
[dev-deps-url]: https://david-dm.org/es-shims/Number.isNaN#info=devDependencies | ||
[npm-badge-png]: https://nodei.co/npm/number.isnan.png?downloads=true&stars=true | ||
[license-image]: https://img.shields.io/npm/l/number.isnan.svg | ||
[license-url]: LICENSE | ||
[downloads-image]: https://img.shields.io/npm/dm/number.isnan.svg | ||
[downloads-url]: https://npm-stat.com/charts.html?package=number.isnan | ||
[codecov-image]: https://codecov.io/gh/es-shims/Number.isNaN/branch/main/graphs/badge.svg | ||
[codecov-url]: https://app.codecov.io/gh/es-shims/Number.isNaN/ | ||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Number.isNaN | ||
[actions-url]: https://github.com/es-shims/Number.isNaN/actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
|
||
require('./shim')(); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'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; |
Oops, something went wrong.