1.1.6 • Published 3 months ago

object-is v1.1.6

Weekly downloads
11,721,764
License
MIT
Repository
github
Last release
3 months ago

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

deep-equalairbnb-prop-typesenzymeenzyme-shallow-equalcomponennenttvuedragdropuploadimagesbb-chat@frxf/frxf@texttree/demo-bsa-reference-rcl@l1nyanm1ng/react-picture-viewercthpb-plugin-socialcogoportutilslevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28levilibtest29@infinitebrahmanuniverse/nolb-object-cclibyarntest@saaspe/componentsexpand-react-bridgesklif-ui-kitsklif-api@everything-registry/sub-chunk-2365sklif-uijulien-easy-modalkinda-abstract-storelevimultiplatform10levimultiplatformtestlevimultitestlevikotlinliblevikotlintestlevilibtest15levilibtest16levilibtest17levilibtest18levilibtest21levilibtest22levilibtest23litepie-datepicker-gabem2m-chartjs-plugin-crosshairhelp-widgethomebridge-sanremo-cubehot-zone-vuejesusdemoinspect-xinteractive-libsmd-vditormncssmicroend-componentmy-library-buttonng-search-dropdownneural_compressor_ext_lab_customizedneural_compressor_ext_lab_customized_2novacap-components@rtsao/react-ssr-prepass@scobru/address-book@pgleeson/enzyme@pgleeson/enzyme-mount-wrapper@pisano/enzyme@podlubnaja/ui-kit@thismr/bitmindtest-core@tonysusi/vapid@torgeircook/cssjson@udooku/react-image-comparison-slider@sudophunk/v4-client@sudophunk/fulido@tbm/enzyme@the91end/react-auth@teyuto/react-player@vasosolo/multiselectcombobox@sleepfinance/chain@olympfin/olymp-swap-lib@skedulr/nebula-ui-library@reagentum/front-core@shivarajapple/first-librarywescheme-jszzzxxxyyy321123webdatabasetest1webdatabasetest10wdio-cucumberwebliblevi3yamensharaf-enzymeanci-reactprova-cmpprova-cpm-2prova-cpm-3prova-cpm-4prova-2-caroselloprasadacmpickupbiz-npm-packagepictawall.sdkpolyglot-component-libraryparvan_reactjs_componentsparvan_componentsqaapio-reecord-mp3
1.1.6

3 months ago

1.1.5

3 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.0

10 years ago