Comparing version
@@ -8,2 +8,15 @@ # Changelog | ||
## [v1.1.4](https://github.com/es-shims/object-is/compare/v1.1.3...v1.1.4) - 2020-11-26 | ||
### Commits | ||
- [Tests] migrate tests to Github Actions [`958ab26`](https://github.com/es-shims/object-is/commit/958ab266fd68396781c076d8a5ee4ba292561362) | ||
- [Tests] add `shimmed` and `implementation` and `index` tests; run `es-shim-api` in postlint; use `tape` runner [`b918fb8`](https://github.com/es-shims/object-is/commit/b918fb849023032d2da61ead95f31b0a03371131) | ||
- [Tests] run `nyc` on all tests [`8f62816`](https://github.com/es-shims/object-is/commit/8f6281683ad58ffe9b5809c2a9e7bb65db344c9c) | ||
- [actions] add "Allow Edits" workflow [`aa419f0`](https://github.com/es-shims/object-is/commit/aa419f0ea2b497844365f9f51a746fa2a57bb6ee) | ||
- [Deps] use `call-bind` instead of `es-abstract` [`4991728`](https://github.com/es-shims/object-is/commit/49917288eddfce31949f5a3351f0e0bb67929a2b) | ||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud` [`3ce2ef5`](https://github.com/es-shims/object-is/commit/3ce2ef5e834bf22566ea5741178cd76bb35f8a89) | ||
- [meta] ignore coverage output [`d778383`](https://github.com/es-shims/object-is/commit/d778383fde9222bc5349dd4adcaab9f5ef10254e) | ||
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`e0d9b41`](https://github.com/es-shims/object-is/commit/e0d9b41a73f51f1c8b9d9b402da5f754926bc280) | ||
## [v1.1.3](https://github.com/es-shims/object-is/compare/v1.1.2...v1.1.3) - 2020-09-30 | ||
@@ -10,0 +23,0 @@ |
'use strict'; | ||
var define = require('define-properties'); | ||
var callBind = require('es-abstract/helpers/callBind'); | ||
var callBind = require('call-bind'); | ||
@@ -6,0 +6,0 @@ var implementation = require('./implementation'); |
{ | ||
"name": "object-is", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "ES2015-compliant shim for Object.is - differentiates between -0 and +0", | ||
@@ -14,8 +14,7 @@ "author": "Jordan Harband", | ||
"pretest": "npm run lint", | ||
"tests-only": "node test", | ||
"tests-only": "nyc tape 'test/**/*.js'", | ||
"test": "npm run tests-only", | ||
"posttest": "npx aud --production", | ||
"coverage": "covert test", | ||
"prelint": "es-shim-api --bound", | ||
"posttest": "aud --production", | ||
"lint": "eslint .", | ||
"postlint": "es-shim-api --bound", | ||
"version": "auto-changelog && git add CHANGELOG.md", | ||
@@ -44,13 +43,14 @@ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" | ||
"dependencies": { | ||
"define-properties": "^1.1.3", | ||
"es-abstract": "^1.18.0-next.1" | ||
"call-bind": "^1.0.0", | ||
"define-properties": "^1.1.3" | ||
}, | ||
"devDependencies": { | ||
"@es-shims/api": "^2.1.2", | ||
"@ljharb/eslint-config": "^17.2.0", | ||
"aud": "^1.1.2", | ||
"@ljharb/eslint-config": "^17.3.0", | ||
"aud": "^1.1.3", | ||
"auto-changelog": "^2.2.1", | ||
"covert": "^1.1.1", | ||
"eslint": "^7.10.0", | ||
"eslint": "^7.14.0", | ||
"functions-have-names": "^1.2.1", | ||
"has-symbols": "^1.0.1", | ||
"nyc": "^10.3.2", | ||
"safe-publish-latest": "^1.1.4", | ||
@@ -57,0 +57,0 @@ "tape": "^5.0.1" |
'use strict'; | ||
var index = require('../'); | ||
var test = require('tape'); | ||
var hasSymbols = require('has-symbols')(); | ||
var is = require('../'); | ||
var runTests = require('./tests'); | ||
test('works with primitives', function (t) { | ||
t.ok(is(), 'two absent args are the same'); | ||
t.ok(is(undefined), 'undefined & one absent arg are the same'); | ||
t.ok(is(undefined, undefined), 'undefined is undefined'); | ||
t.ok(is(null, null), 'null is null'); | ||
t.ok(is(true, true), 'true is true'); | ||
t.ok(is(false, false), 'false is false'); | ||
t.notOk(is(true, false), 'true is not false'); | ||
t.end(); | ||
}); | ||
test('as a function', function (t) { | ||
runTests(index, t); | ||
test('works with NaN', function (t) { | ||
t.ok(is(NaN, NaN), 'NaN is NaN'); | ||
t.end(); | ||
}); | ||
test('differentiates zeroes', function (t) { | ||
t.ok(is(0, 0), '+0 is +0'); | ||
t.ok(is(-0, -0), '-0 is -0'); | ||
t.notOk(is(0, -0), '+0 is not -0'); | ||
t.end(); | ||
}); | ||
test('nonzero numbers', function (t) { | ||
t.ok(is(Infinity, Infinity), 'infinity is infinity'); | ||
t.ok(is(-Infinity, -Infinity), 'infinity is infinity'); | ||
t.ok(is(42, 42), '42 is 42'); | ||
t.notOk(is(42, -42), '42 is not -42'); | ||
t.end(); | ||
}); | ||
test('strings', function (t) { | ||
t.ok(is('', ''), 'empty string is empty string'); | ||
t.ok(is('foo', 'foo'), 'string is string'); | ||
t.notOk(is('foo', 'bar'), 'string is not different string'); | ||
t.end(); | ||
}); | ||
test('objects', function (t) { | ||
var obj = {}; | ||
t.ok(is(obj, obj), 'object is same object'); | ||
t.notOk(is(obj, {}), 'object is not different object'); | ||
t.end(); | ||
}); | ||
test('Symbols', { skip: !hasSymbols }, function (t) { | ||
t.ok(is(Symbol.iterator, Symbol.iterator), 'Symbol.iterator is itself'); | ||
t.notOk(is(Symbol(), Symbol()), 'different Symbols are not equal'); | ||
t.notOk(is(Symbol.iterator, Object(Symbol.iterator)), 'Symbol.iterator is not boxed form of itself'); | ||
t.end(); | ||
}); |
Sorry, the diff of this file is not supported yet
27454
39.65%22
69.23%135
39.18%10
11.11%+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed