ES6 module supporting JavaScript and TypeScript.
Supports checking:
- Objects
- Arrays
- Maps
- Sets
- TypedArray
- RegExp
- Date
- Primitives and primitive wrappers (String, Number, Boolean)
- null, undefined, and NaN.
npm install deep-equal-jsAlternatively, if you use Yarn:
yarn add deep-equal-jsimport deepEqual from 'deep-equal-js';
console.log(deepEqual({ a: 1, b: 2 }, { a: 1, b: 2 })); // true
console.log(deepEqual([1, 2], [1, 2])); // true
console.log(deepEqual(9, 9)); // true
console.log(deepEqual('test', 'test')); // true
console.log(deepEqual(NaN, NaN)) // true
console.log(deepEqual(9, '9')); // false
console.log(deepEqual(null, undefined)); // falseWe welcome contributions from the community to make this library better. If you find any issues or have suggestions for improvements, feel free to contribute or open an issue on our GitHub Repository.
This project is licensed under the MIT License - see the LICENSE file for details.
If you find any issues or have suggestions for improvements, feel free to contribute or open an issue on our GitHub Repository.