deep-equal (2.2.3)
Published 2026-02-24 13:55:15 +00:00 by atheaadmin
Installation
registry=npm install deep-equal@2.2.3"deep-equal": "2.2.3"About this package
deep-equal 
Node's assert.deepEqual() algorithm as a standalone module, that also works in browser environments.
It mirrors the robustness of node's own assert.deepEqual and is robust against later builtin modification.
example
var equal = require('deep-equal');
console.dir([
equal(
{ a : [ 2, 3 ], b : [ 4 ] },
{ a : [ 2, 3 ], b : [ 4 ] }
),
equal(
{ x : 5, y : [6] },
{ x : 5, y : 6 }
)
]);
methods
var deepEqual = require('deep-equal')
deepEqual(a, b, opts)
Compare objects a and b, returning whether they are equal according to a recursive equality algorithm.
If opts.strict is true, use strict equality (===) to compare leaf nodes.
The default is to use coercive equality (==) because that's how assert.deepEqual() works by default.
install
With npm do:
npm install deep-equal
test
With npm do:
npm test
Dependencies
Dependencies
| ID | Version |
|---|---|
| array-buffer-byte-length | ^1.0.0 |
| call-bind | ^1.0.5 |
| es-get-iterator | ^1.1.3 |
| get-intrinsic | ^1.2.2 |
| is-arguments | ^1.1.1 |
| is-array-buffer | ^3.0.2 |
| is-date-object | ^1.0.5 |
| is-regex | ^1.1.4 |
| is-shared-array-buffer | ^1.0.2 |
| isarray | ^2.0.5 |
| object-is | ^1.1.5 |
| object-keys | ^1.1.1 |
| object.assign | ^4.1.4 |
| regexp.prototype.flags | ^1.5.1 |
| side-channel | ^1.0.4 |
| which-boxed-primitive | ^1.0.2 |
| which-collection | ^1.0.1 |
| which-typed-array | ^1.1.13 |
Development Dependencies
| ID | Version |
|---|---|
| @ljharb/eslint-config | ^21.1.0 |
| aud | ^2.0.3 |
| auto-changelog | ^2.4.0 |
| available-typed-arrays | ^1.0.5 |
| eslint | =8.8.0 |
| for-each | ^0.3.3 |
| has-proto | ^1.0.1 |
| has-symbols | ^1.0.3 |
| has-typed-arrays | ^1.0.1 |
| in-publish | ^2.0.1 |
| npmignore | ^0.3.0 |
| nyc | ^10.3.2 |
| object.getownpropertydescriptors | ^2.1.7 |
| safe-publish-latest | ^2.0.0 |
| semver | ^6.3.1 |
| tape | ^5.7.2 |
Keywords
equality
equal
compare
Details
Assets (1)
Versions (2)
View all
deep-equal-2.2.3.tgz
22 KiB
