
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
@ver0/deep-equal
Advanced tools
When comparing objects in JavaScript, the built-in equality operators (==
and ===
) only check for reference
equality, not structural equality. This means that two objects with the same properties and values will be considered
different if they're not the same instance.
Many deep equality solutions exist (like lodash's isEqual
, fast-deep-equal, and others), but they often have
limitations:
This package aims to provide a comprehensive single solution that addresses all these concerns while maintaining excellent performance.
# Using npm
npm install @ver0/deep-equal
# Using yarn
yarn add @ver0/deep-equal
# Using pnpm
pnpm add @ver0/deep-equal
The API is extremely simple - just import the isEqual
function and use it to compare any two values:
import {isEqual} from '@ver0/deep-equal';
// Comparing objects
isEqual({a: 1, b: 2}, {a: 1, b: 2}); // true
isEqual({a: 1, b: 2}, {a: 1, b: 3}); // false
// Handling circular references
const obj1 = {a: 1};
const obj2 = {a: 1};
obj1.self = obj1;
obj2.self = obj2;
isEqual(obj1, obj2); // true
// Works with various data types and containers
isEqual(new Date('2023-01-01'), new Date('2023-01-01')); // true
isEqual(new Set([1, 2]), new Set([1, 2])); // true
isEqual(new Map([['a', 1]]), new Map([['a', 1]])); // true
isEqual(/abc/g, /abc/g); // true
// Correctly handles special cases
isEqual(NaN, NaN); // true
Check out the benchmarks by running npm run benchmark
in the project directory.
While benchmark results may show this package isn't the fastest solution available, this is a deliberate trade-off.
The performance cost comes from supporting circular reference detection. Rather than splitting this into separate functions, I've prioritized simplicity in both the API design and implementation, eliminating the need for users to choose between different comparison functions.
FAQs
Deep values comparator for JS
The npm package @ver0/deep-equal receives a total of 44,385 weekly downloads. As such, @ver0/deep-equal popularity was classified as popular.
We found that @ver0/deep-equal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.