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

@wordpress/is-shallow-equal

Package Overview
Dependencies
Maintainers
25
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/is-shallow-equal - npm Package Compare versions

Comparing version 4.22.0 to 4.23.0

2

CHANGELOG.md

@@ -5,2 +5,4 @@ <!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->

## 4.23.0 (2022-12-14)
## 4.22.0 (2022-11-16)

@@ -7,0 +9,0 @@

4

package.json
{
"name": "@wordpress/is-shallow-equal",
"version": "4.22.0",
"version": "4.23.0",
"description": "Test for shallow equality between two objects or arrays.",

@@ -44,3 +44,3 @@ "author": "The WordPress Contributors",

},
"gitHead": "7ac04f446242452d3cb24372f9ca58f0cae97715"
"gitHead": "1eb65aabe6738097f4c062e78f69ae8f05879848"
}

@@ -32,7 +32,7 @@ # Is Shallow Equal

Shallow comparison differs from deep comparison by the fact that it compares members from each as being strictly equal to the other, meaning that arrays and objects will be compared by their _references_, not by their values (see also [_Object Equality in JavaScript_.](http://adripofjavascript.com/blog/drips/object-equality-in-javascript.html)) In situations where nested objects must be compared by value, consider using [Lodash's `isEqual`](https://lodash.com/docs/4.17.11#isEqual) instead.
Shallow comparison differs from deep comparison by the fact that it compares members from each as being strictly equal to the other, meaning that arrays and objects will be compared by their _references_, not by their values (see also [_Object Equality in JavaScript_.](http://adripofjavascript.com/blog/drips/object-equality-in-javascript.html)) In situations where nested objects must be compared by value, consider using [`fast-deep-equal`](https://github.com/epoberezkin/fast-deep-equal) instead.
```js
import isShallowEqual from '@wordpress/is-shallow-equal';
import { isEqual } from 'lodash'; // deep comparison
import fastDeepEqual from 'fast-deep-equal/es6'; // deep comparison

@@ -44,3 +44,3 @@ let object = { a: 1 };

isEqual( [ { a: 1 } ], [ { a: 1 } ] );
fastDeepEqual( [ { a: 1 } ], [ { a: 1 } ] );
// ⇒ true

@@ -47,0 +47,0 @@

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