Compares two items by value and returns true if they are deeply equal.
Rules:
makeIsDeepEqual
isDeepEqual(1)(1); // trueisDeepEqual(1)(2); // falseisDeepEqual([1, 2, 3])([1, 2, 3]); // trueisDeepEqual([1, 2, 3])([1, 2, 4]); // falseisDeepEqual({ a: 1, b: [1, 2] })({ a: 1, b: [1, 2] }); // trueisDeepEqual({ a: 1, b: [1, 2] })({ a: 1, b: [1, 3] }); // falseisDeepEqual(new Date('2021-01-01'))(new Date('2021-01-01')); // trueisDeepEqual(new Date('2021-01-01'))(new Date('2021-01-02')); // falseisDeepEqual(/a/g)(/a/g); // trueisDeepEqual(/a/g)(/b/g); // falseisDeepEqual(null)(null); // trueisDeepEqual(null)(undefined); // falseisDeepEqual(undefined)(undefined); // trueisDeepEqual( { props: { children: 'Hello', $$typeof: Symbol, _owner: 'xxx' } })( { props: { children: 'Hello', $$typeof: Symbol, _owner: 'yyy' } }); // true Copy
isDeepEqual(1)(1); // trueisDeepEqual(1)(2); // falseisDeepEqual([1, 2, 3])([1, 2, 3]); // trueisDeepEqual([1, 2, 3])([1, 2, 4]); // falseisDeepEqual({ a: 1, b: [1, 2] })({ a: 1, b: [1, 2] }); // trueisDeepEqual({ a: 1, b: [1, 2] })({ a: 1, b: [1, 3] }); // falseisDeepEqual(new Date('2021-01-01'))(new Date('2021-01-01')); // trueisDeepEqual(new Date('2021-01-01'))(new Date('2021-01-02')); // falseisDeepEqual(/a/g)(/a/g); // trueisDeepEqual(/a/g)(/b/g); // falseisDeepEqual(null)(null); // trueisDeepEqual(null)(undefined); // falseisDeepEqual(undefined)(undefined); // trueisDeepEqual( { props: { children: 'Hello', $$typeof: Symbol, _owner: 'xxx' } })( { props: { children: 'Hello', $$typeof: Symbol, _owner: 'yyy' } }); // true
Compares two items by value and returns true if they are deeply equal.
Rules:
See
makeIsDeepEqual
Example