Gathering detailed insights and metrics for dequal
Gathering detailed insights and metrics for dequal
Gathering detailed insights and metrics for dequal
Gathering detailed insights and metrics for dequal
A tiny (304B to 489B) utility to check for deep equality
npm install dequal
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.8
Supply Chain
99.5
Quality
75.5
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
1,728,150,449
Last Day
977,366
Last Week
19,456,169
Last Month
83,713,024
Last Year
840,661,778
MIT License
1,425 Stars
58 Commits
31 Forks
16 Watchers
1 Branches
4 Contributors
Updated on Jul 02, 2025
Minified
Minified + Gzipped
Latest Version
2.0.3
Package Id
dequal@2.0.3
Unpacked Size
13.90 kB
Size
4.19 kB
File Count
11
NPM Version
8.11.0
Node Version
18.3.0
Cumulative downloads
Total Downloads
Last Day
-6.3%
977,366
Compared to previous day
Last Week
-7.5%
19,456,169
Compared to previous week
Last Month
2.8%
83,713,024
Compared to previous month
Last Year
38.6%
840,661,778
Compared to previous year
A tiny (304B to 489B) utility to check for deep equality
This module supports comparison of all types, including Function
, RegExp
, Date
, Set
, Map
, TypedArray
s, DataView
, null
, undefined
, and NaN
values. Complex values (eg, Objects, Arrays, Sets, Maps, etc) are traversed recursively.
Important:
- key order within Objects does not matter
- value order within Arrays does matter
- values within Sets and Maps use value equality
- keys within Maps use value equality
$ npm install --save dequal
There are two "versions" of dequal
available:
dequal
Size (gzip): 489 bytes
Availability: CommonJS, ES Module, UMD
dequal/lite
IE9+ | Number | String | Date | RegExp | Object | Array | Class | Set | Map | ArrayBuffer | TypedArray | DataView | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dequal | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
dequal/lite | :+1: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
Note: Table scrolls horizontally!
1import { dequal } from 'dequal'; 2 3dequal(1, 1); //=> true 4dequal({}, {}); //=> true 5dequal('foo', 'foo'); //=> true 6dequal([1, 2, 3], [1, 2, 3]); //=> true 7dequal(dequal, dequal); //=> true 8dequal(/foo/, /foo/); //=> true 9dequal(null, null); //=> true 10dequal(NaN, NaN); //=> true 11dequal([], []); //=> true 12dequal( 13 [{ a:1 }, [{ b:{ c:[1] } }]], 14 [{ a:1 }, [{ b:{ c:[1] } }]] 15); //=> true 16 17dequal(1, '1'); //=> false 18dequal(null, undefined); //=> false 19dequal({ a:1, b:[2,3] }, { a:1, b:[2,5] }); //=> false 20dequal(/foo/i, /bar/g); //=> false
Returns: Boolean
Both foo
and bar
can be of any type.
A Boolean
is returned indicating if the two were deeply equal.
Running Node v10.13.0
The benchmarks can be found in the /bench
directory. They are separated into two categories:
basic
– compares an object comprised of String
, Number
, Date
, Array
, and Object
values.complex
– like basic
, but adds RegExp
, Map
, Set
, and Uint8Array
values.Note: Only candidates that pass validation step(s) are listed.
For example,fast-deep-equal/es6
handlesSet
andMap
values, but uses referential equality while those listed use value equality.
Load times:
assert 0.109ms
util 0.006ms
fast-deep-equal 0.479ms
lodash/isequal 22.826ms
nano-equal 0.417ms
dequal 0.396ms
dequal/lite 0.264ms
Benchmark :: basic
assert.deepStrictEqual x 325,262 ops/sec ±0.57% (94 runs sampled)
util.isDeepStrictEqual x 318,812 ops/sec ±0.87% (94 runs sampled)
fast-deep-equal x 1,332,393 ops/sec ±0.36% (93 runs sampled)
lodash.isEqual x 269,129 ops/sec ±0.59% (95 runs sampled)
nano-equal x 1,122,053 ops/sec ±0.36% (96 runs sampled)
dequal/lite x 1,700,972 ops/sec ±0.31% (94 runs sampled)
dequal x 1,698,972 ops/sec ±0.63% (97 runs sampled)
Benchmark :: complex
assert.deepStrictEqual x 124,518 ops/sec ±0.64% (96 runs sampled)
util.isDeepStrictEqual x 125,113 ops/sec ±0.24% (96 runs sampled)
lodash.isEqual x 58,677 ops/sec ±0.49% (96 runs sampled)
dequal x 345,386 ops/sec ±0.27% (96 runs sampled)
MIT © Luke Edwards
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 4/15 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
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
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
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