Deep Equality with Object Identity Checks

JSON →
library 1.1.1 ·javascript
verified May 27, 2026

deep-equal-ident is a JavaScript utility function that performs a deep comparison between two values, extending the functionality typically found in libraries like Lodash's `isEqual`. While most deep equality checks, including Lodash's, only compare the *values* of nested objects, `deep-equal-ident` critically tracks and compares the *identity* of nested objects and arrays. This means that two structures like `[[a, a]]` and `[[a, b]]` will be considered unequal by `deep-equal-ident` even if `a` and `b` are themselves deeply value-equal, because the former contains two references to the *same* object `a`, while the latter contains references to two *different* objects (`a` and `b`). This distinction is crucial for preserving structural integrity, mirroring how a robust deep cloning algorithm would behave, ensuring that if two structures are deemed equal, they will behave identically under mutation. The current stable version is 1.1.1, with recent updates focused on stability fixes. It is primarily intended for unit testing scenarios, offering direct integration with the Chai.js assertion framework for both `expect` and `assert` interfaces.

total hits 36
actors 8 distinct systems
last hit 1d ago human
ByteDance
8
Amazonbot
4
MetaBot
4
GPTBot
2
Script
1
ClaudeBot
1
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇸🇬 Singapore · 🇫🇷 France · 🇩🇪 Germany