Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deep-equal

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-equal

node's assert.deepEqual algorithm

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21M
decreased by-7.19%
Maintainers
2
Weekly downloads
 
Created

What is deep-equal?

The deep-equal npm package is a library for performing deep equality checks between two values. It is useful for comparing objects, arrays, and other nested structures to determine if they are equivalent in structure and content, regardless of whether they are the same reference in memory.

What are deep-equal's main functionalities?

Deep comparison of objects and arrays

This feature allows you to compare objects and arrays to see if they are structurally identical, even if they are different instances.

const deepEqual = require('deep-equal');

const obj1 = { a: 1, b: { c: 1 } };
const obj2 = { a: 1, b: { c: 1 } };

console.log(deepEqual(obj1, obj2)); // true

Comparison with custom options

This feature allows you to specify options for the comparison, such as strict mode, which requires the values to be of the same type as well.

const deepEqual = require('deep-equal');

const obj1 = { a: 1 };
const obj2 = { a: '1' };
const options = { strict: true };

console.log(deepEqual(obj1, obj2, options)); // false

Other packages similar to deep-equal

Keywords

FAQs

Package last updated on 01 Apr 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc