@wordpress/is-shallow-equal
Advanced tools
Comparing version 4.22.0 to 4.23.0
@@ -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 @@ |
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68677