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

dequal

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dequal

A tiny (305B) utility for check for deep equality

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12M
decreased by-25.57%
Maintainers
1
Weekly downloads
 
Created

What is dequal?

The dequal npm package is a library for performing deep equality checks. It is a lightweight and fast utility for comparing objects, arrays, and other nested data structures to determine if they are equivalent in value.

What are dequal's main functionalities?

Deep equality check for objects

This feature allows you to compare two objects deeply to check if they are equal in value, regardless of whether they are different instances.

const { dequal } = require('dequal');
let obj1 = { a: 1, b: { c: 2 } };
let obj2 = { a: 1, b: { c: 2 } };
console.log(dequal(obj1, obj2)); // true

Deep equality check for arrays

This feature allows you to compare two arrays deeply to check if they are equal in value, including nested arrays.

const { dequal } = require('dequal');
let arr1 = [1, [2, 3]];
let arr2 = [1, [2, 3]];
console.log(dequal(arr1, arr2)); // true

Deep equality check for mixed structures

This feature allows you to compare mixed data structures like objects containing arrays or arrays containing objects to check for deep equality.

const { dequal } = require('dequal');
let mix1 = { a: [1, { b: 2 }] };
let mix2 = { a: [1, { b: 2 }] };
console.log(dequal(mix1, mix2)); // true

Other packages similar to dequal

Keywords

FAQs

Package last updated on 15 Jul 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