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

value-equal

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

value-equal

Are these two JavaScript values equal?

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.8M
decreased by-1.82%
Maintainers
1
Weekly downloads
 
Created

What is value-equal?

The value-equal npm package is a simple utility for checking the equality of two values. It is primarily used to determine if two values are equivalent in terms of their actual content, rather than being the same reference. This is particularly useful in scenarios where deep comparison of objects, arrays, or other complex data structures is required.

What are value-equal's main functionalities?

Deep Equality Check

This feature allows you to check if two values are equivalent, looking deeply into the structure of objects or arrays. It returns true if the values are equivalent, otherwise false.

const valueEqual = require('value-equal');

console.log(valueEqual({ a: 1 }, { a: 1 })); // true
console.log(valueEqual([1, 2], [1, 2])); // true
console.log(valueEqual('hello', 'hello')); // true
console.log(valueEqual(42, 42)); // true
console.log(valueEqual(null, null)); // true
console.log(valueEqual(undefined, undefined)); // true
console.log(valueEqual({ a: 1 }, { a: 2 })); // false

Other packages similar to value-equal

FAQs

Package last updated on 02 Dec 2018

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