@wordpress/is-shallow-equal 4.21.0 → 4.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.23.0 (2022-12-14)
6
+
7
+ ## 4.22.0 (2022-11-16)
8
+
5
9
  ## 4.21.0 (2022-11-02)
6
10
 
7
11
  ## 4.20.0 (2022-10-19)
package/README.md CHANGED
@@ -29,18 +29,18 @@ import { isShallowEqualArrays } from '@wordpress/is-shallow-equal';
29
29
  import { isShallowEqualObjects } from '@wordpress/is-shallow-equal';
30
30
  ```
31
31
 
32
- 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.
32
+ 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.
33
33
 
34
34
  ```js
35
35
  import isShallowEqual from '@wordpress/is-shallow-equal';
36
- import { isEqual } from 'lodash'; // deep comparison
36
+ import fastDeepEqual from 'fast-deep-equal/es6'; // deep comparison
37
37
 
38
38
  let object = { a: 1 };
39
39
 
40
40
  isShallowEqual( [ { a: 1 } ], [ { a: 1 } ] );
41
41
  // ⇒ false
42
42
 
43
- isEqual( [ { a: 1 } ], [ { a: 1 } ] );
43
+ fastDeepEqual( [ { a: 1 } ], [ { a: 1 } ] );
44
44
  // ⇒ true
45
45
 
46
46
  isShallowEqual( [ object ], [ object ] );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/is-shallow-equal",
3
- "version": "4.21.0",
3
+ "version": "4.23.0",
4
4
  "description": "Test for shallow equality between two objects or arrays.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "511f4cc1f0138641bc4394bc1cf36e833109c791"
44
+ "gitHead": "1eb65aabe6738097f4c062e78f69ae8f05879848"
45
45
  }