@woosh/meep-engine 2.47.37 → 2.47.39
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/build/meep.cjs +28 -12
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +28 -12
- package/package.json +2 -1
- package/src/core/collection/array/isArraysEqualWithComparator.js +9 -6
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.js +22 -6
- package/src/core/model/node-graph/node/NodeDescription.js +14 -1
- package/src/core/model/node-graph/node/NodeRegistry.js +1 -1
- package/src/core/model/object/objectDeepEquals.js +22 -6
package/build/meep.cjs
CHANGED
|
@@ -77598,28 +77598,31 @@ function planesEqual(a, b) {
|
|
|
77598
77598
|
* @template T
|
|
77599
77599
|
* @param {T[]} a
|
|
77600
77600
|
* @param {T[]} b
|
|
77601
|
-
* @param {function(T,T):boolean}
|
|
77601
|
+
* @param {function(T,T):boolean} elements_equal
|
|
77602
77602
|
* @returns {boolean}
|
|
77603
77603
|
*/
|
|
77604
|
-
function isArraysEqualWithComparator(a, b,
|
|
77604
|
+
function isArraysEqualWithComparator(a, b, elements_equal) {
|
|
77605
77605
|
if (a === b) {
|
|
77606
|
+
// same object
|
|
77606
77607
|
return true;
|
|
77607
77608
|
}
|
|
77608
77609
|
|
|
77609
77610
|
if (a === null || b === null || a === undefined || b === undefined) {
|
|
77611
|
+
// check if one of the arrays is missing
|
|
77610
77612
|
return false
|
|
77611
77613
|
}
|
|
77612
77614
|
|
|
77613
|
-
const
|
|
77614
|
-
|
|
77615
|
+
const element_count = a.length;
|
|
77616
|
+
|
|
77617
|
+
if (element_count !== b.length) {
|
|
77615
77618
|
return false;
|
|
77616
77619
|
}
|
|
77617
77620
|
|
|
77618
|
-
for (let i = 0; i <
|
|
77621
|
+
for (let i = 0; i < element_count; i++) {
|
|
77619
77622
|
const aE = a[i];
|
|
77620
77623
|
const bE = b[i];
|
|
77621
77624
|
|
|
77622
|
-
if (!
|
|
77625
|
+
if (!elements_equal(aE, bE)) {
|
|
77623
77626
|
return false;
|
|
77624
77627
|
}
|
|
77625
77628
|
}
|
|
@@ -100735,16 +100738,29 @@ function objectDeepEquals(a, b) {
|
|
|
100735
100738
|
}
|
|
100736
100739
|
|
|
100737
100740
|
if (tA === "object") {
|
|
100738
|
-
|
|
100739
|
-
|
|
100740
|
-
if (!
|
|
100741
|
+
if (Array.isArray(a)) {
|
|
100742
|
+
// special fast path for arrays
|
|
100743
|
+
if (!Array.isArray(b)) {
|
|
100744
|
+
// one is an array, the other is not
|
|
100741
100745
|
return false;
|
|
100742
100746
|
}
|
|
100747
|
+
return isArraysEqualWithComparator(a, b, objectDeepEquals);
|
|
100743
100748
|
}
|
|
100744
100749
|
|
|
100745
|
-
|
|
100746
|
-
|
|
100747
|
-
|
|
100750
|
+
const keys_a = Object.keys(a);
|
|
100751
|
+
const keys_b = Object.keys(b);
|
|
100752
|
+
|
|
100753
|
+
if (!isArrayEqualStrict(keys_a, keys_b)) {
|
|
100754
|
+
// different fields
|
|
100755
|
+
return false;
|
|
100756
|
+
}
|
|
100757
|
+
|
|
100758
|
+
const key_count = keys_a.length;
|
|
100759
|
+
|
|
100760
|
+
for (let i = 0; i < key_count; i++) {
|
|
100761
|
+
const key = keys_a[i];
|
|
100762
|
+
|
|
100763
|
+
if (!objectDeepEquals(a[key], b[key])) {
|
|
100748
100764
|
return false;
|
|
100749
100765
|
}
|
|
100750
100766
|
}
|