Gathering detailed insights and metrics for nested-equal
Gathering detailed insights and metrics for nested-equal
Gathering detailed insights and metrics for nested-equal
Gathering detailed insights and metrics for nested-equal
deep-equal-in-any-order
chai plugin to match objects and arrays deep equality with arrays (including nested ones) being in any order
object-all-values-equal-to
Does the AST/nested-plain-object/array/whatever contain only one kind of value?
deep-equal-nested-array
Deep Equal for nested JSON objects along with array
equal-checker
Lightweight function to check if two Objects, Arrays, or single Values are equal. Uses Recursion to check any combination and level of NESTING.
🧬 A tiny (~239B) and fast nested/deep equality utility
npm install nested-equal
Typescript
Module System
Node Version
NPM Version
61.8
Supply Chain
90.3
Quality
75.3
Maintenance
100
Vulnerability
100
License
TypeScript (53.81%)
JavaScript (46.19%)
Total Downloads
5,868
Last Day
1
Last Week
12
Last Month
85
Last Year
1,584
MIT License
14 Commits
1 Watchers
9 Branches
1 Contributors
Updated on Feb 16, 2022
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
nested-equal@1.0.1
Unpacked Size
14.36 kB
Size
4.04 kB
File Count
12
NPM Version
6.14.4
Node Version
12.16.3
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-33.3%
12
Compared to previous week
Last Month
-62.2%
85
Compared to previous month
Last Year
-17.9%
1,584
Compared to previous year
A tiny (~239B) and super fast deep/nested equality utility.
Takes 2 values and returns a boolean indicating if they are equal or not by traversing recursively.
Supports Objects
, Arrays
, Numbers
, Strings
, null
, undefined
, NaN
, Functions
. Other types like Map
, Set
, Date
and others use reference equality instead of value equality.
Key order within objects does not matter while value order within arrays does matter.
1$ npm install nested-equal
1import { nestedEqual } from "nested-equal"; 2 3nestedEqual({},{}); // true 4nestedEqual({a:1},{a:1}); // true 5nestedEqual([1,2],[1,3]); // false 6nestedEqual(NaN,NaN); // true 7nestedEqual([1,2,3],[1,2,3]); // true 8nestedEqual([ 9 {a:'value',b:'value'}, 10 {a:'value',b:'value'}, 11],[ 12 {a:'value',b:'value'}, 13 {a:'value',b:'value'}, 14]) // true 15nestedEqual(5,'5'); // false 16nestedEqual(null,null); // true 17nestedEqual(null,undefined); // false
Claiming a library is fast without looking into the data structure is naive at best, since the data structure largely impacts performance as no algorithm can handle all the different data structures. Hence a couple of benchmarks were made with some different data structures to compare it to other popular libararies.
Benchmark 1
lodash.isequal x 66,593 ops/sec ±0.43% (92 runs sampled)
deep-equal x 772 ops/sec ±4.45% (43 runs sampled)
nested-equal x 458,818 ops/sec ±0.40% (91 runs sampled)
dequal x 431,045 ops/sec ±0.23% (95 runs sampled)
nano-equal x 284,753 ops/sec ±0.37% (89 runs sampled)
Benchmark 2
lodash.isequal x 853,636 ops/sec ±0.67% (91 runs sampled)
deep-equal x 2,172 ops/sec ±1.83% (75 runs sampled)
nested-equal x 6,034,107 ops/sec ±0.72% (93 runs sampled)
dequal x 5,302,918 ops/sec ±0.70% (95 runs sampled)
nano-equal x 3,542,214 ops/sec ±0.24% (93 runs sampled)
Benchmark 3
lodash.isequal x 14,347,632 ops/sec ±0.89% (91 runs sampled)
deep-equal x 4,502 ops/sec ±1.76% (72 runs sampled)
nested-equal x 21,252,686 ops/sec ±0.31% (93 runs sampled)
dequal x 21,489,939 ops/sec ±0.32% (94 runs sampled)
nano-equal x 28,915,716 ops/sec ±0.49% (94 runs sampled)
Benchmark 4
lodash.isequal x 63,600 ops/sec ±1.16% (64 runs sampled)
deep-equal x 1,420 ops/sec ±0.64% (88 runs sampled)
nested-equal x 2,909,724 ops/sec ±0.22% (91 runs sampled)
dequal x 4,138,053 ops/sec ±0.25% (94 runs sampled)
nano-equal x 1,662,534 ops/sec ±2.92% (90 runs sampled)
Benchmark 5
lodash.isequal x 70,076 ops/sec ±0.93% (90 runs sampled)
deep-equal x 2,113 ops/sec ±0.54% (88 runs sampled)
nested-equal x 7,432,844 ops/sec ±0.22% (93 runs sampled)
dequal x 7,161,662 ops/sec ±0.61% (94 runs sampled)
nano-equal x 4,496,048 ops/sec ±0.59% (94 runs sampled)
Running on Node.js v12.13.0, 64-bit OS, Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz, 16.0 GB RAM
Returns: Boolean
Returns true or false indicating if the two values are equal or not.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
20 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More