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

@gilbarbara/deep-equal

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gilbarbara/deep-equal

Tiny deep equal comparator

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
495K
increased by12.07%
Maintainers
1
Weekly downloads
 
Created

What is @gilbarbara/deep-equal?

@gilbarbara/deep-equal is an npm package that provides functionality to deeply compare two JavaScript objects or values to determine if they are equivalent. It is useful for scenarios where a shallow comparison is insufficient, such as comparing nested objects or arrays.

What are @gilbarbara/deep-equal's main functionalities?

Deep Comparison of Objects

This feature allows you to deeply compare two objects to check if they are equivalent. The code sample demonstrates comparing two nested objects.

const deepEqual = require('@gilbarbara/deep-equal');
const obj1 = { a: 1, b: { c: 2 } };
const obj2 = { a: 1, b: { c: 2 } };
console.log(deepEqual(obj1, obj2)); // true

Deep Comparison of Arrays

This feature allows you to deeply compare two arrays to check if they are equivalent. The code sample demonstrates comparing two nested arrays.

const deepEqual = require('@gilbarbara/deep-equal');
const arr1 = [1, [2, 3], 4];
const arr2 = [1, [2, 3], 4];
console.log(deepEqual(arr1, arr2)); // true

Deep Comparison of Mixed Types

This feature allows you to deeply compare mixed types, such as objects containing arrays and other objects. The code sample demonstrates comparing two complex nested structures.

const deepEqual = require('@gilbarbara/deep-equal');
const mixed1 = { a: [1, 2, { b: 3 }] };
const mixed2 = { a: [1, 2, { b: 3 }] };
console.log(deepEqual(mixed1, mixed2)); // true

Other packages similar to @gilbarbara/deep-equal

Keywords

FAQs

Package last updated on 06 Mar 2022

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