@yr/is-equal
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

NPM Version Build Status

Determine whether two objects are conceptually equal.

Usage

const isEqual = require('@yr/is-equal')
  , obj = {};

// The following are all 'true'
isEqual(obj, {});
isEqual([], []);
isEqual(['foo'], ['foo']);
isEqual(null, null);
isEqual(NaN, NaN);
isEqual({ foo: 'foo', bar: true }, { bar: true, foo: 'foo' });
isEqual({ foo: null }, { foo: null });
isEqual({ foo: ['foo', 'bar'] }, { foo: ['foo', 'bar'] });
// Function properties are ignored
isEqual({ foo: 'bar', bar: function () {} }, { foo: 'bar' });
// Optional ignored properties
isEqual({ foo: 'bar', bar: true }, { bar: true, foo: 'foo' }, ['foo']);

Readme

Keywords

none

Package Sidebar

Install

npm i @yr/is-equal

Weekly Downloads

1

Version

3.0.0

License

MIT

Unpacked Size

14.7 kB

Total Files

11

Last publish

Collaborators

  • yr
  • saegrov