Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

deep-equal-js

mallikcheripally6.1kMIT0.2.2TypeScript support: included

Blazing fast utility for deep equality checks

deep equal, equal, equals, deep compare, fast deep equal, fast compare, fast, equality, check equal

readme

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.

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

0.2.2 (2024-11-26)

Chores

  • update .npmignore to exclude additional files (6426464)

0.2.1 (2024-11-26)

Chores

  • update .npmignore to include CHANGELOG.md (902ba14)

0.2.0 (2024-11-26)

Code Refactoring

  • improve deepEqual function with performance and readability (5bd41ad)

Documentation

0.1.1 (2024-11-21)

Code Refactoring

  • remove excessive comments from deepEqual function (30a0910)

Documentation

  • update README to include JavaScript support (e97f7da)

0.1.0 (2024-11-18)

Features

  • add CI pipeline with Node.js and Codecov integration (a9e318c)

Bug Fixes

  • correct deepEqual function's Map comparison logic (085ef0a)
  • tests: correct string comparison in deep-equal tests (3340390)
  • tests: correct String object instantiation (fd3ca9a)

Code Refactoring

  • simplify deepEqual function logic (e176e99)

Chores

  • config: update TypeScript target to ES2020 (06fdab5)

Tests

  • add new test cases for deepEqual function (9e4e203)
  • add tests for deep equality of String objects (7d63a07)

Documentation

  • README: update README to include badges and examples (ba2e6b8)
  • update README description for clarity (789427a)
  • update URLs and add contribution guidelines (d2828ee)

0.0.1 (2024-11-15)

Features

  • add deepEqual utility function (3ab50c4)
  • add initial project setup with config files (941bb3f)

Tests

  • add unit test for deepEqual function (b679353)

Chores

  • add initial configuration files for project setup (648e27c)
  • rename index.js to index.ts (bcfdbb6)