node's deepEqual and deepStrictEqual algorithm.
npm install deep-equal-x href="https://travis-ci.org/Xotic750/deep-equal-x"
title="Travis status"> src="https://travis-ci.org/Xotic750/deep-equal-x.svg?branch=master"
alt="Travis status" height="18">
href="https://david-dm.org/Xotic750/deep-equal-x"
title="Dependency status"> alt="Dependency status" height="18"/>
href="https://david-dm.org/Xotic750/deep-equal-x?type=dev"
title="devDependency status"> alt="devDependency status" height="18"/>
href="https://badge.fury.io/js/deep-equal-x"
title="npm version"> alt="npm version" height="18">
href="https://www.jsdelivr.com/package/npm/deep-equal-x"
title="jsDelivr hits"> alt="jsDelivr hits" height="18">
href="https://bettercodehub.com/results/Xotic750/deep-equal-x"
title="bettercodehub score"> alt="bettercodehub score" height="18">
href="https://coveralls.io/github/Xotic750/deep-equal-x?branch=master"
title="Coverage Status"> alt="Coverage Status" height="18">
node's deepEqual and deepStrictEqual algorithm.
Tests for deep equality. Primitive values are compared with the equal
comparison operator ( == ). This only considers enumerable properties.
It does not test object prototypes, attached symbols, or non-enumerable
properties. This can lead to some potentially surprising results. Ifstrict is true then Primitive values are compared with the strict
equal comparison operator ( === ).
Kind: Exported function
Returns: boolean - true if actual and expected are deemed equal,
otherwise false.
See: https://nodejs.org/api/assert.html
| Param | Type | Description |
| -------- | -------------------- | -------------------------------------------- |
| actual | \* | First comparison object. |
| expected | \* | Second comparison object. |
| [strict] | boolean | Comparison mode. If set to true use ===. |
Example
``js
import deepEqual from 'deep-equal-x';
deepEqual(Error('a'), Error('b'));
// => true
// This does not return false because the properties on the Error object
// are non-enumerable:
deepEqual(4, '4');
// => true
deepEqual({a: 4, b: '1'}, {b: '1', a: 4});
// => true
deepEqual(new Date(), new Date(2000, 3, 14));
// => false
deepEqual(4, '4', true);
// => false
``