Comparing version
12
index.js
@@ -1,6 +0,6 @@ | ||
"use strict"; | ||
'use strict'; | ||
/* https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.is */ | ||
// http://www.ecma-international.org/ecma-262/6.0/#sec-object.is | ||
var NumberIsNaN = function (value) { | ||
var numberIsNaN = function (value) { | ||
return value !== value; | ||
@@ -12,5 +12,7 @@ }; | ||
return 1 / a === 1 / b; | ||
} else if (a === b) { | ||
} | ||
if (a === b) { | ||
return true; | ||
} else if (NumberIsNaN(a) && NumberIsNaN(b)) { | ||
} | ||
if (numberIsNaN(a) && numberIsNaN(b)) { | ||
return true; | ||
@@ -17,0 +19,0 @@ } |
{ | ||
"name": "object-is", | ||
"version": "1.0.1", | ||
"description": "ES6-compliant shim for Object.is - differentiates between -0 and +0", | ||
"version": "1.0.2", | ||
"description": "ES2015-compliant shim for Object.is - differentiates between -0 and +0", | ||
"author": "Jordan Harband", | ||
"funding": { | ||
"url": "https://github.com/sponsors/ljharb" | ||
}, | ||
"license": "MIT", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "npm run lint && node test.js && npm run coverage-quiet", | ||
"coverage": "covert test.js", | ||
"coverage-quiet": "covert test.js --quiet", | ||
"lint": "jscs *.js" | ||
"version": "auto-changelog && git add CHANGELOG.md", | ||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", | ||
"pretest": "npm run lint", | ||
"tests-only": "node test", | ||
"test": "npm run tests-only", | ||
"posttest": "npx aud", | ||
"coverage": "covert test", | ||
"lint": "eslint ." | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/ljharb/object-is.git" | ||
"url": "git://github.com/es-shims/object-is.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/ljharb/object-is/issues" | ||
"url": "https://github.com/es-shims/object-is/issues" | ||
}, | ||
"homepage": "https://github.com/ljharb/object-is", | ||
"homepage": "https://github.com/es-shims/object-is", | ||
"keywords": [ | ||
@@ -28,2 +35,3 @@ "is", | ||
"ES6", | ||
"ES2015", | ||
"shim", | ||
@@ -34,5 +42,8 @@ "polyfill" | ||
"devDependencies": { | ||
"tape": "~2.14.0", | ||
"covert": "~1.0.0", | ||
"jscs": "~1.5.9" | ||
"@ljharb/eslint-config": "^15.0.2", | ||
"auto-changelog": "^1.16.2", | ||
"covert": "^1.1.1", | ||
"eslint": "^6.7.2", | ||
"has-symbols": "^1.0.1", | ||
"tape": "^4.11.0" | ||
}, | ||
@@ -60,4 +71,10 @@ "testling": { | ||
"node": ">= 0.4" | ||
}, | ||
"auto-changelog": { | ||
"output": "CHANGELOG.md", | ||
"template": "keepachangelog", | ||
"unreleased": false, | ||
"commitLimit": false, | ||
"backfillLimit": false | ||
} | ||
} | ||
#object-is <sup>[![Version Badge][2]][1]</sup> | ||
[![Build Status][3]][4] [![dependency status][5]][6] [![dev dependency status][7]][8] | ||
[![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] | ||
[![browser support][9]][10] | ||
ES2015-compliant shim for Object.is - differentiates between -0 and +0, and can compare to NaN. | ||
ES6-compliant shim for Object.is - differentiates between -0 and +0, and can compare to NaN. | ||
Essentially, Object.is returns the same value as === - but true for NaN, and false for -0 and +0. | ||
@@ -44,12 +46,14 @@ | ||
[1]: https://npmjs.org/package/object-is | ||
[2]: http://vb.teelaun.ch/ljharb/object-is.svg | ||
[3]: https://travis-ci.org/ljharb/object-is.svg | ||
[4]: https://travis-ci.org/ljharb/object-is | ||
[5]: https://david-dm.org/ljharb/object-is.svg | ||
[6]: https://david-dm.org/ljharb/object-is | ||
[7]: https://david-dm.org/ljharb/object-is/dev-status.svg | ||
[8]: https://david-dm.org/ljharb/object-is#info=devDependencies | ||
[9]: https://ci.testling.com/ljharb/object-is.png | ||
[10]: https://ci.testling.com/ljharb/object-is | ||
[2]: http://versionbadg.es/es-shims/object-is.svg | ||
[3]: https://travis-ci.org/es-shims/object-is.svg | ||
[4]: https://travis-ci.org/es-shims/object-is | ||
[5]: https://david-dm.org/es-shims/object-is.svg | ||
[6]: https://david-dm.org/es-shims/object-is | ||
[7]: https://david-dm.org/es-shims/object-is/dev-status.svg | ||
[8]: https://david-dm.org/es-shims/object-is#info=devDependencies | ||
[11]: https://nodei.co/npm/object-is.png?downloads=true&stars=true | ||
[license-image]: http://img.shields.io/npm/l/object-is.svg | ||
[license-url]: LICENSE | ||
[downloads-image]: http://img.shields.io/npm/dm/object-is.svg | ||
[downloads-url]: http://npm-stat.com/charts.html?package=object-is | ||
Sorry, the diff of this file is not supported yet
16498
110.01%9
12.5%59
7.27%6
100%66
-26.67%