
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@react-hookz/deep-equal
Advanced tools
[!CAUTION] PACKAGE IS DEPRECATED AND WILL BE DETED SOON
USE @ver0/deep-equal instead
The fastest deep comparator for JS/TS.
Map
, Set
, TypedArray
, DataView
, and ArrayBuffer
.Date
, RegExp
, and NaN
.Object.create(null)
.It's as simple as:
npm install @react-hookz/deep-equal
# or
yarn add @react-hookz/deep-equal
This package is distributed using the ESNext language level and ES module system. Depending on your target environment, you might need to transpile the package. Check your bundler's documentation for instructions on transpiling node_modules
.
import { isEqual } from '@react-hookz/deep-equal';
isEqual({ a: 1 }, { a: 1 }); // true
Note: Benchmarks were conducted on specific datasets (available in the src/fixtures
directory). Your results may vary depending on your data and use case. Running benchmarks on your dataset is recommended.
name hz min max mean p75 p99 p995 p999 rme samples · @react-hookz/deep-equal 1,780,770.64 0.0005 0.7278 0.0006 0.0006 0.0010 0.0011 0.0013 ±0.18% 1780771 fastest · react-fast-compare 1,690,244.66 0.0005 3.2804 0.0006 0.0006 0.0010 0.0012 0.0013 ±0.65% 1690245 · fast-deep-equal 1,663,437.00 0.0005 3.5417 0.0006 0.0006 0.0010 0.0011 0.0012 ±0.70% 1663438 slowest · dequal 1,693,113.15 0.0005 3.2976 0.0006 0.0006 0.0007 0.0010 0.0012 ±0.65% 1693114
name hz min max mean p75 p99 p995 p999 rme samples · @react-hookz/deep-equal 1,725,589.83 0.0005 0.2565 0.0006 0.0006 0.0009 0.0010 0.0012 ±0.20% 1725590 fastest · react-fast-compare 1,406,227.02 0.0006 0.1635 0.0007 0.0007 0.0011 0.0014 0.0016 ±0.21% 1406228 · fast-deep-equal 1,553,848.07 0.0005 2.7540 0.0006 0.0007 0.0008 0.0011 0.0013 ±0.57% 1553849 · dequal 1,026,213.59 0.0008 0.1810 0.0010 0.0010 0.0011 0.0012 0.0019 ±0.16% 1026214 slowest
To get more detailed benchmarks for different data types, run the tests directly on your own machine:
git clone https://github.com/react-hookz/deep-equal
cd deep-equal
corepack enable
yarn
yarn benchmark
Anton Zinovyev |
Kyle Holmberg |
Pasecinic Nichita |
FAQs
Fast deep equal comparator
The npm package @react-hookz/deep-equal receives a total of 130,086 weekly downloads. As such, @react-hookz/deep-equal popularity was classified as popular.
We found that @react-hookz/deep-equal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.