Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

object-is

es-shims52.7mMIT1.1.6

ES2015-compliant shim for Object.is - differentiates between -0 and +0

is, Object.is, equality, sameValueZero, ES6, ES2015, shim, polyfill, es-shim API

readme

object-is Version Badge

github actions coverage License Downloads

npm badge

ES2015-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.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.

Example

Object.is = require('object-is');
var assert = require('assert');

assert.ok(Object.is());
assert.ok(Object.is(undefined));
assert.ok(Object.is(undefined, undefined));
assert.ok(Object.is(null, null));
assert.ok(Object.is(true, true));
assert.ok(Object.is(false, false));
assert.ok(Object.is('foo', 'foo'));

var arr = [1, 2];
assert.ok(Object.is(arr, arr));
assert.equal(Object.is(arr, [1, 2]), false);

assert.ok(Object.is(0, 0));
assert.ok(Object.is(-0, -0));
assert.equal(Object.is(0, -0), false);

assert.ok(Object.is(NaN, NaN));
assert.ok(Object.is(Infinity, Infinity));
assert.ok(Object.is(-Infinity, -Infinity));

Tests

Simply clone the repo, npm install, and run npm test

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.1.6 - 2024-02-27

Commits

  • [actions] reuse common workflows f8d0c06
  • [actions] use node/install instead of node/run 90fc019
  • [actions] update workflows 37339d8
  • [meta] use npmignore to autogenerate an npmignore file a257c19
  • [readme] fix badges 50af053
  • [Dev Deps] update eslint, @ljharb/eslint-config, @es-shims/api, safe-publish-latest, tape 86058c6
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, functions-have-names, has-symbols, tape d5484eb
  • [actions] update rebase action to use reusable workflow 68075c5
  • [actions] update codecov uploader f12fbb2
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, has-symbols, tape 43eb235
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, aud, npmignore, tape f306966
  • [readme] add actions and codecov badges e443b4a
  • [readme] remove travis badge 5165adc
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape e7ccf56
  • [Deps] update call-bind, define-properties a3052db
  • [readme] fix URLs ac37ea6
  • [readme] assert.notOk -> assert.equal 7fe769f
  • [Deps] update call-bind b965cd3
  • [Dev Deps] update tape a737830
  • [Deps] update define-properties, es-abstract 441eafb

v1.1.5 - 2021-02-20

Commits

  • [meta] do not publish github action workflow files ec00b0f
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, tape 279645e
  • [actions] update workflows 6b4ef5a
  • [Dev Deps] update eslint, functions-have-names, tape f5fd32a
  • [Deps] update call-bind 0fafc13
  • [Deps] update call-bind e28a929
  • [readme] Add note about es-shim API f903cc1

v1.1.4 - 2020-11-26

Commits

  • [Tests] migrate tests to Github Actions 958ab26
  • [Tests] add shimmed and implementation and index tests; run es-shim-api in postlint; use tape runner b918fb8
  • [Tests] run nyc on all tests 8f62816
  • [actions] add "Allow Edits" workflow aa419f0
  • [Deps] use call-bind instead of es-abstract 4991728
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud 3ce2ef5
  • [meta] ignore coverage output d778383
  • [actions] switch Automatic Rebase workflow to pull_request_target event e0d9b41

v1.1.3 - 2020-09-30

Commits

  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape 6f1217f
  • [Dev Deps] update eslint, @ljharb/eslint-config, auto-changelog 68d8ab0
  • [Deps] update es-abstract d665d57
  • [Deps] update es-abstract 61b4d08

v1.1.2 - 2020-04-14

Commits

  • [Fix] avoid mutating the builtin Object.is in the main entry point 5988702

v1.1.1 - 2020-04-14

Fixed

  • [Deps] add missing define-properties #10

v1.1.0 - 2020-04-14

Commits

  • [New] convert to es-shim-api interface c8b6e9f
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape; add safe-publish-latest 222a2a9
  • [Dev Deps] update auto-changelog, tape 1ea6a92
  • [Dev Deps] update auto-changelog; add aud 1d129e0
  • [Tests] only audit prod deps ad12386

v1.0.2 - 2019-12-15

Commits

  • [Tests] use shared travis-ci configs eb56ddf
  • [Tests] up to node v12.6, v11.15, v10.16, v9.11, v8.16, v7.10, v6.17, v5.12, 4.9; use nvm install-latest-npm a5bb4e3
  • [Tests] remove jscs 1929690
  • Using my standard jscs.json file. a7621dc
  • [meta] run auto-changelog 5c551c4
  • Update tape, covert, jscs bd84112
  • [meta] move repo to es-shims org 15d3cdc
  • Test up to io.js v2.2 d1d2de4
  • Update tape, jscs b40e85f
  • Add npm run eslint a80ee81
  • Only apps should have lockfiles f70677a
  • [actions] add automatic rebasing / merge commit blocking 27780d3
  • [Tests] use npx aud instead of nsp or npm audit with hoops cf886ce
  • [Dev Deps] update eslint, @ljharb/eslint-config, has-symbols b70e146
  • [meta] add version scripts 25a5308
  • [Tests] up to node v12.10 b6e934c
  • [Dev Deps] update tape, jscs df38b5a
  • Adding license and downloads badges c743f09
  • [Dev Deps] update eslint, @ljharb/eslint-config, covert, tape 41d1c5b
  • Add tests for Symbols. 8189ca7
  • [Tests] up to io.js v3.3, node v4.1 698c449
  • Add npm run security 1fe530a
  • Test up to io.js v3.0 cd6ac03
  • [Refactor] no-else-return a590382
  • [docs] clean up some links 422df90
  • All grade A-supported node/iojs versions now ship with an npm that understands ^. 8684418
  • Run travis-ci tests on iojs and node v0.12; speed up builds; allow 0.8 failures. 6b618ac
  • [readme] prefer ES2015 over ES6 9aae9f9
  • [meta] use keepachangelog with auto-changelog 3abdcd9
  • [Dev Deps] update eslint, @ljharb/eslint-config 65da8bb
  • [Tests] use has-symbols 9c88ec7
  • Update tape, jscs abc6021
  • Update jscs f85f0ba
  • Update tape, jscs 9c8b28b
  • Using single quotes. 46a566e
  • [meta] add funding field f71e665
  • [Dev Deps] update tape 694a94e
  • Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. 4b29a71
  • Update jscs 204e6fe
  • Lock covert to v1.0.0. efc5a21
  • Updating tape d1ff721
  • Updating jscs 35b4df9
  • Updating jscs 46c3b9d
  • Updating jscs 75c9b8b

v1.0.1 - 2014-08-27

Merged

  • Use svg instead of png to get better image quality #2

Commits

v1.0.0 - 2014-08-01

Commits

v0.0.0 - 2014-02-17

Commits