@wordpress/is-shallow-equal 5.36.1-next.738bb1424.0 → 5.37.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 +2 -0
- package/build/{arrays.cjs → arrays.js} +1 -1
- package/build/{index.cjs → index.js} +7 -7
- package/build/index.js.map +7 -0
- package/build/{objects.cjs → objects.js} +1 -1
- package/build-module/index.js +6 -5
- package/build-module/index.js.map +3 -3
- package/build-types/index.d.ts +2 -6
- package/build-types/index.d.ts.map +1 -1
- package/package.json +5 -6
- package/src/index.ts +3 -4
- package/build/index.cjs.map +0 -7
- /package/build/{arrays.cjs.map → arrays.js.map} +0 -0
- /package/build/{objects.cjs.map → objects.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -31,13 +31,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
default: () => isShallowEqual,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
isShallowEqualObjects: () => import_objects.default
|
|
34
|
+
isShallowEqualArrays: () => import_arrays2.default,
|
|
35
|
+
isShallowEqualObjects: () => import_objects2.default
|
|
37
36
|
});
|
|
38
37
|
module.exports = __toCommonJS(index_exports);
|
|
39
|
-
var import_objects = __toESM(require("./objects
|
|
40
|
-
var import_arrays = __toESM(require("./arrays
|
|
38
|
+
var import_objects = __toESM(require("./objects"));
|
|
39
|
+
var import_arrays = __toESM(require("./arrays"));
|
|
40
|
+
var import_objects2 = __toESM(require("./objects"));
|
|
41
|
+
var import_arrays2 = __toESM(require("./arrays"));
|
|
41
42
|
function isShallowEqual(a, b) {
|
|
42
43
|
if (a && b) {
|
|
43
44
|
if (a.constructor === Object && b.constructor === Object) {
|
|
@@ -50,8 +51,7 @@ function isShallowEqual(a, b) {
|
|
|
50
51
|
}
|
|
51
52
|
// Annotate the CommonJS export names for ESM import in node:
|
|
52
53
|
0 && (module.exports = {
|
|
53
|
-
isShallowEqual,
|
|
54
54
|
isShallowEqualArrays,
|
|
55
55
|
isShallowEqualObjects
|
|
56
56
|
});
|
|
57
|
-
//# sourceMappingURL=index.
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport isShallowEqualObjects from './objects';\nimport isShallowEqualArrays from './arrays';\n\nexport { default as isShallowEqualObjects } from './objects';\nexport { default as isShallowEqualArrays } from './arrays';\n\nexport type ComparableObject = Record< string, any >;\n\n/**\n * Returns true if the two arrays or objects are shallow equal, or false\n * otherwise. Also handles primitive values, just in case.\n *\n * @param a First object or array to compare.\n * @param b Second object or array to compare.\n *\n * @return Whether the two values are shallow equal.\n */\nexport default function isShallowEqual( a: unknown, b: unknown ): boolean {\n\tif ( a && b ) {\n\t\tif ( a.constructor === Object && b.constructor === Object ) {\n\t\t\treturn isShallowEqualObjects( a, b );\n\t\t} else if ( Array.isArray( a ) && Array.isArray( b ) ) {\n\t\t\treturn isShallowEqualArrays( a, b );\n\t\t}\n\t}\n\n\treturn a === b;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAkC;AAClC,oBAAiC;AAEjC,IAAAA,kBAAiD;AACjD,IAAAC,iBAAgD;AAajC,SAAR,eAAiC,GAAY,GAAsB;AACzE,MAAK,KAAK,GAAI;AACb,QAAK,EAAE,gBAAgB,UAAU,EAAE,gBAAgB,QAAS;AAC3D,iBAAO,eAAAC,SAAuB,GAAG,CAAE;AAAA,IACpC,WAAY,MAAM,QAAS,CAAE,KAAK,MAAM,QAAS,CAAE,GAAI;AACtD,iBAAO,cAAAC,SAAsB,GAAG,CAAE;AAAA,IACnC;AAAA,EACD;AAEA,SAAO,MAAM;AACd;",
|
|
6
|
+
"names": ["import_objects", "import_arrays", "isShallowEqualObjects", "isShallowEqualArrays"]
|
|
7
|
+
}
|
package/build-module/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// packages/is-shallow-equal/src/index.ts
|
|
2
|
-
import isShallowEqualObjects from "./objects
|
|
3
|
-
import isShallowEqualArrays from "./arrays
|
|
2
|
+
import isShallowEqualObjects from "./objects";
|
|
3
|
+
import isShallowEqualArrays from "./arrays";
|
|
4
|
+
import { default as default2 } from "./objects";
|
|
5
|
+
import { default as default3 } from "./arrays";
|
|
4
6
|
function isShallowEqual(a, b) {
|
|
5
7
|
if (a && b) {
|
|
6
8
|
if (a.constructor === Object && b.constructor === Object) {
|
|
@@ -13,8 +15,7 @@ function isShallowEqual(a, b) {
|
|
|
13
15
|
}
|
|
14
16
|
export {
|
|
15
17
|
isShallowEqual as default,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
isShallowEqualObjects
|
|
18
|
+
default3 as isShallowEqualArrays,
|
|
19
|
+
default2 as isShallowEqualObjects
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport isShallowEqualObjects from './objects';\nimport isShallowEqualArrays from './arrays';\n\nexport type ComparableObject = Record< string, any >;\n\n/**\n * Returns true if the two arrays or objects are shallow equal, or false\n * otherwise. Also handles primitive values, just in case.\n *\n * @param a First object or array to compare.\n * @param b Second object or array to compare.\n *\n * @return Whether the two values are shallow equal.\n */\nexport default function isShallowEqual( a: unknown, b: unknown ): boolean {\n\tif ( a && b ) {\n\t\tif ( a.constructor === Object && b.constructor === Object ) {\n\t\t\treturn isShallowEqualObjects( a, b );\n\t\t} else if ( Array.isArray( a ) && Array.isArray( b ) ) {\n\t\t\treturn isShallowEqualArrays( a, b );\n\t\t}\n\t}\n\n\treturn a === b;\n}\n
|
|
5
|
-
"mappings": ";AAGA,OAAO,2BAA2B;AAClC,OAAO,0BAA0B;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport isShallowEqualObjects from './objects';\nimport isShallowEqualArrays from './arrays';\n\nexport { default as isShallowEqualObjects } from './objects';\nexport { default as isShallowEqualArrays } from './arrays';\n\nexport type ComparableObject = Record< string, any >;\n\n/**\n * Returns true if the two arrays or objects are shallow equal, or false\n * otherwise. Also handles primitive values, just in case.\n *\n * @param a First object or array to compare.\n * @param b Second object or array to compare.\n *\n * @return Whether the two values are shallow equal.\n */\nexport default function isShallowEqual( a: unknown, b: unknown ): boolean {\n\tif ( a && b ) {\n\t\tif ( a.constructor === Object && b.constructor === Object ) {\n\t\t\treturn isShallowEqualObjects( a, b );\n\t\t} else if ( Array.isArray( a ) && Array.isArray( b ) ) {\n\t\t\treturn isShallowEqualArrays( a, b );\n\t\t}\n\t}\n\n\treturn a === b;\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,2BAA2B;AAClC,OAAO,0BAA0B;AAEjC,SAAoB,WAAXA,gBAAwC;AACjD,SAAoB,WAAXA,gBAAuC;AAajC,SAAR,eAAiC,GAAY,GAAsB;AACzE,MAAK,KAAK,GAAI;AACb,QAAK,EAAE,gBAAgB,UAAU,EAAE,gBAAgB,QAAS;AAC3D,aAAO,sBAAuB,GAAG,CAAE;AAAA,IACpC,WAAY,MAAM,QAAS,CAAE,KAAK,MAAM,QAAS,CAAE,GAAI;AACtD,aAAO,qBAAsB,GAAG,CAAE;AAAA,IACnC;AAAA,EACD;AAEA,SAAO,MAAM;AACd;",
|
|
6
|
+
"names": ["default"]
|
|
7
7
|
}
|
package/build-types/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
import isShallowEqualObjects from './objects';
|
|
5
|
-
import isShallowEqualArrays from './arrays';
|
|
1
|
+
export { default as isShallowEqualObjects } from './objects';
|
|
2
|
+
export { default as isShallowEqualArrays } from './arrays';
|
|
6
3
|
export type ComparableObject = Record<string, any>;
|
|
7
4
|
/**
|
|
8
5
|
* Returns true if the two arrays or objects are shallow equal, or false
|
|
@@ -14,5 +11,4 @@ export type ComparableObject = Record<string, any>;
|
|
|
14
11
|
* @return Whether the two values are shallow equal.
|
|
15
12
|
*/
|
|
16
13
|
export default function isShallowEqual(a: unknown, b: unknown): boolean;
|
|
17
|
-
export { isShallowEqual, isShallowEqualObjects, isShallowEqualArrays };
|
|
18
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAE,MAAM,EAAE,GAAG,CAAE,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAI,OAAO,CAUxE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/is-shallow-equal",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.37.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",
|
|
@@ -25,20 +25,19 @@
|
|
|
25
25
|
"npm": ">=8.19.2"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
|
-
"src",
|
|
29
28
|
"build",
|
|
30
29
|
"build-module",
|
|
31
30
|
"build-types",
|
|
31
|
+
"src",
|
|
32
32
|
"*.md"
|
|
33
33
|
],
|
|
34
|
-
"
|
|
35
|
-
"main": "build/index.cjs",
|
|
34
|
+
"main": "build/index.js",
|
|
36
35
|
"module": "build-module/index.js",
|
|
37
36
|
"exports": {
|
|
38
37
|
".": {
|
|
39
38
|
"types": "./build-types/index.d.ts",
|
|
40
39
|
"import": "./build-module/index.js",
|
|
41
|
-
"require": "./build/index.
|
|
40
|
+
"require": "./build/index.js"
|
|
42
41
|
},
|
|
43
42
|
"./package.json": "./package.json"
|
|
44
43
|
},
|
|
@@ -49,5 +48,5 @@
|
|
|
49
48
|
"publishConfig": {
|
|
50
49
|
"access": "public"
|
|
51
50
|
},
|
|
52
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "2cf13ec6cf86153c9b3cf369bf5c59046f5cd950"
|
|
53
52
|
}
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
import isShallowEqualObjects from './objects';
|
|
5
5
|
import isShallowEqualArrays from './arrays';
|
|
6
6
|
|
|
7
|
+
export { default as isShallowEqualObjects } from './objects';
|
|
8
|
+
export { default as isShallowEqualArrays } from './arrays';
|
|
9
|
+
|
|
7
10
|
export type ComparableObject = Record< string, any >;
|
|
8
11
|
|
|
9
12
|
/**
|
|
@@ -26,7 +29,3 @@ export default function isShallowEqual( a: unknown, b: unknown ): boolean {
|
|
|
26
29
|
|
|
27
30
|
return a === b;
|
|
28
31
|
}
|
|
29
|
-
|
|
30
|
-
// `isShallowEqual` is exported also as a named export because esbuild cannot
|
|
31
|
-
// expose the default export from the `window.wp.isShallowEqual` global.
|
|
32
|
-
export { isShallowEqual, isShallowEqualObjects, isShallowEqualArrays };
|
package/build/index.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport isShallowEqualObjects from './objects';\nimport isShallowEqualArrays from './arrays';\n\nexport type ComparableObject = Record< string, any >;\n\n/**\n * Returns true if the two arrays or objects are shallow equal, or false\n * otherwise. Also handles primitive values, just in case.\n *\n * @param a First object or array to compare.\n * @param b Second object or array to compare.\n *\n * @return Whether the two values are shallow equal.\n */\nexport default function isShallowEqual( a: unknown, b: unknown ): boolean {\n\tif ( a && b ) {\n\t\tif ( a.constructor === Object && b.constructor === Object ) {\n\t\t\treturn isShallowEqualObjects( a, b );\n\t\t} else if ( Array.isArray( a ) && Array.isArray( b ) ) {\n\t\t\treturn isShallowEqualArrays( a, b );\n\t\t}\n\t}\n\n\treturn a === b;\n}\n\n// `isShallowEqual` is exported also as a named export because esbuild cannot\n// expose the default export from the `window.wp.isShallowEqual` global.\nexport { isShallowEqual, isShallowEqualObjects, isShallowEqualArrays };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,4CAAAA;AAAA,EAAA,4CAAAC;AAAA;AAAA;AAGA,qBAAkC;AAClC,oBAAiC;AAalB,SAAR,eAAiC,GAAY,GAAsB;AACzE,MAAK,KAAK,GAAI;AACb,QAAK,EAAE,gBAAgB,UAAU,EAAE,gBAAgB,QAAS;AAC3D,iBAAO,eAAAA,SAAuB,GAAG,CAAE;AAAA,IACpC,WAAY,MAAM,QAAS,CAAE,KAAK,MAAM,QAAS,CAAE,GAAI;AACtD,iBAAO,cAAAD,SAAsB,GAAG,CAAE;AAAA,IACnC;AAAA,EACD;AAEA,SAAO,MAAM;AACd;",
|
|
6
|
-
"names": ["isShallowEqualArrays", "isShallowEqualObjects"]
|
|
7
|
-
}
|
|
File without changes
|
|
File without changes
|