1.1.6 • Published 2 months ago

object-is v1.1.6

Weekly downloads
11,721,764
License
MIT
Repository
github
Last release
2 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-equalenzymeenzyme-shallow-equalairbnb-prop-typescomponennenttvuedragdropuploadimagesbb-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-uizzzxxxyyy321123react-rect-progressbarreact-otp-input-uptdreactofy-css-libraryreact-voice-actionsprova-cmpprova-cpm-2prova-cpm-3prova-cpm-4prova-2-caroselloqa_hddqaapio-reecord-mp3react-ssr-prepass-customreact-ssr-prepass-forkreact-solid-gradient-pickerreact-microphone-recorder1sticky-scroll-catchtapereact-angular-componentreact-ang-notifications-honey-comb-setupreact-credoreact-dry-rendererspittet-enzymesvelvet-customstyle-guide-maintest-carosello-campustesting-storybooktestweblibapitldrawlignintingzi-vuepresstinymce-plugin-toytype-libarysam-carouselsamc2samc3samc4samc5reyhan-projectshainawdio-cucumberyamensharaf-enzymewebliblevi3webdatabasetest1webdatabasetest10wescheme-jsstanikionestnenopmoc-iustock-ticker-react-widgetuhnoxi-music-webuhnoxi-music-web-buildu-libraryumd-assertverify-img-codevue-button-test1vformlmqvirtual-tour-guide@igniswap/igni-swap-lib@innoswap/core@invrs/enzyme@img-arena/img-ui-mui-theme@knightlin/enzyme@knooks/use-title@kodinghandle/bullswap-lib@kirrosh/pts@kmwork/front-core@juanaraneta/dept-central-lib-client@kandelvijaya/homebridge-philipsair-platform@imrtoy/homebridge-night-light@img-arena/ui-core@itayn-fireberry-org/itayn-test@hieuquang2212/form
1.1.6

2 months ago

1.1.5

3 years ago

1.1.4

3 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