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

muggle-deep-equal

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

muggle-deep-equal - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "muggle-deep-equal",
"version": "1.0.1",
"version": "1.0.2",
"description": "A simple and generic implementation of deep equal",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -52,14 +52,14 @@ # muggle-deep-equal

1. #### If either value is a primitive, then equality is determined using strict equality `===`
#### 1. If either value is a primitive, then equality is determined using strict equality `===`
- `String`, `Number`, `Boolean`, `Function`, `Symbol`, `undefined`, or `null`
- `NaN` is considered equal to `NaN`
2. #### Both objects must have the same class.
#### 2. Both objects must have the same class.
- `object1.constructor.name === object2.constructor.name`
3. #### If either object is an [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), then equality is determined by checking that both contain the same values in the same order.
#### 3. If either object is an [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), then equality is determined by checking that both contain the same values in the same order.
- Values are compared by applying these deep equal rules recursively.
- Every index is compared 1 at a time in order using the [iterator protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterator_protocol)
- Rules #4 and #5 aren't applied to iterables
4. #### Both objects must have the same properties and values.
#### 4. Both objects must have the same properties and values.
- Compared by applying these deep equal rules recursively on every value using a [for...in loop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in)
5. #### Both objects must return the same string representation from `object.toString()`
#### 5. Both objects must return the same string representation from `object.toString()`
- This allows many other objects to be compared as expected such as `Error`, `Date`, and `RegExp`
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