deep-equal-js
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

deep-equal-js

Blazing fast utility for deep equality checks.

Features

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.

Installation

npm install deep-equal-js

Alternatively, if you use Yarn:

yarn add deep-equal-js

Usage

import 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
conseole.log(deepEqual(9, '9')); // false
console.log(deepEqual(null, undefined)); // false

Contributing

We 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.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Something Missing?

If you find any issues or have suggestions for improvements, feel free to contribute or open an issue on our GitHub Repository.

Package Sidebar

Install

npm i deep-equal-js

Weekly Downloads

1,875

Version

0.2.2

License

MIT

Unpacked Size

14.7 kB

Total Files

7

Last publish

Collaborators

  • mallikcheripally