@symbo.ls/scratch 2.11.470 → 2.11.475
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/dist/cjs/factory.js +42 -66
- package/dist/cjs/index.js +84 -132
- package/dist/cjs/set.js +84 -132
- package/dist/cjs/system/color.js +84 -132
- package/dist/cjs/system/document.js +84 -132
- package/dist/cjs/system/font.js +84 -132
- package/dist/cjs/system/index.js +84 -132
- package/dist/cjs/system/reset.js +84 -132
- package/dist/cjs/system/shadow.js +84 -132
- package/dist/cjs/system/spacing.js +84 -132
- package/dist/cjs/system/svg.js +84 -132
- package/dist/cjs/system/theme.js +84 -132
- package/dist/cjs/system/timing.js +84 -132
- package/dist/cjs/system/typography.js +84 -132
- package/dist/cjs/transforms/index.js +84 -132
- package/dist/cjs/utils/color.js +42 -66
- package/dist/cjs/utils/index.js +84 -132
- package/dist/cjs/utils/sequence.js +84 -132
- package/dist/cjs/utils/sprite.js +42 -66
- package/dist/cjs/utils/var.js +84 -132
- package/package.json +5 -5
package/dist/cjs/system/index.js
CHANGED
|
@@ -346,11 +346,11 @@ var require_array = __commonJS({
|
|
|
346
346
|
var joinArrays = (...arrays) => {
|
|
347
347
|
return [].concat(...arrays);
|
|
348
348
|
};
|
|
349
|
-
var mergeArray = (arr,
|
|
350
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
349
|
+
var mergeArray = (arr, exclude = []) => {
|
|
350
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
351
351
|
};
|
|
352
352
|
var mergeAndCloneIfArray = (obj) => {
|
|
353
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
353
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
354
354
|
};
|
|
355
355
|
var cutArrayBeforeValue = (arr, value) => {
|
|
356
356
|
const index = arr.indexOf(value);
|
|
@@ -599,8 +599,6 @@ var require_object = __commonJS({
|
|
|
599
599
|
createNestedObject: () => createNestedObject,
|
|
600
600
|
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
601
601
|
deepClone: () => deepClone2,
|
|
602
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
603
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
604
602
|
deepContains: () => deepContains,
|
|
605
603
|
deepDestringify: () => deepDestringify,
|
|
606
604
|
deepDiff: () => deepDiff,
|
|
@@ -694,78 +692,56 @@ var require_object = __commonJS({
|
|
|
694
692
|
}
|
|
695
693
|
return o;
|
|
696
694
|
};
|
|
697
|
-
var
|
|
698
|
-
|
|
699
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
700
|
-
}
|
|
701
|
-
const o = {};
|
|
702
|
-
for (const k in obj) {
|
|
703
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
704
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
705
|
-
continue;
|
|
706
|
-
let v = obj[k];
|
|
707
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
708
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
709
|
-
}
|
|
710
|
-
if ((0, import_types.isArray)(v)) {
|
|
711
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
712
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
713
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
714
|
-
} else
|
|
715
|
-
o[k] = v;
|
|
716
|
-
}
|
|
717
|
-
return o;
|
|
695
|
+
var mergeArrayExclude = (arr, exclude = []) => {
|
|
696
|
+
return arr.reduce((acc, curr) => deepMerge3(acc, deepClone2(curr, { exclude })), {});
|
|
718
697
|
};
|
|
719
|
-
var
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
698
|
+
var deepClone2 = (obj, options = {}) => {
|
|
699
|
+
const {
|
|
700
|
+
exclude = [],
|
|
701
|
+
cleanUndefined = false,
|
|
702
|
+
cleanNull = false,
|
|
703
|
+
window: targetWindow,
|
|
704
|
+
visited = /* @__PURE__ */ new WeakMap(),
|
|
705
|
+
handleExtend = false
|
|
706
|
+
} = options;
|
|
707
|
+
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
724
708
|
return obj;
|
|
725
|
-
|
|
709
|
+
}
|
|
710
|
+
if (visited.has(obj)) {
|
|
726
711
|
return visited.get(obj);
|
|
727
|
-
|
|
712
|
+
}
|
|
713
|
+
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
728
714
|
visited.set(obj, clone2);
|
|
729
715
|
for (const key in obj) {
|
|
730
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
return clone2;
|
|
744
|
-
};
|
|
745
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
746
|
-
if ((0, import_types.isObjectLike)(obj)) {
|
|
747
|
-
if (visited.has(obj)) {
|
|
748
|
-
return obj;
|
|
716
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
717
|
+
continue;
|
|
718
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
719
|
+
continue;
|
|
720
|
+
const value = obj[key];
|
|
721
|
+
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
722
|
+
continue;
|
|
723
|
+
if ((0, import_node.isDOMNode)(value)) {
|
|
724
|
+
clone2[key] = value;
|
|
725
|
+
continue;
|
|
749
726
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
753
|
-
for (const prop in obj) {
|
|
754
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
727
|
+
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
728
|
+
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
755
729
|
continue;
|
|
756
|
-
|
|
757
|
-
if (
|
|
730
|
+
}
|
|
731
|
+
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
732
|
+
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
758
733
|
continue;
|
|
759
734
|
}
|
|
760
|
-
if ((0, import_types.isObjectLike)(
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
735
|
+
if ((0, import_types.isObjectLike)(value)) {
|
|
736
|
+
clone2[key] = deepClone2(value, {
|
|
737
|
+
...options,
|
|
738
|
+
visited
|
|
739
|
+
});
|
|
764
740
|
} else {
|
|
765
|
-
|
|
741
|
+
clone2[key] = value;
|
|
766
742
|
}
|
|
767
743
|
}
|
|
768
|
-
return
|
|
744
|
+
return clone2;
|
|
769
745
|
};
|
|
770
746
|
var deepStringify = (obj, stringified = {}) => {
|
|
771
747
|
var _a, _b;
|
|
@@ -1784,7 +1760,7 @@ var require_component = __commonJS({
|
|
|
1784
1760
|
if (newChild === null)
|
|
1785
1761
|
assignChild(null);
|
|
1786
1762
|
else if (!childElem)
|
|
1787
|
-
assignChild((0, import__.
|
|
1763
|
+
assignChild((0, import__.deepClone)(newChild));
|
|
1788
1764
|
else {
|
|
1789
1765
|
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
1790
1766
|
if (isSugarChildElem)
|
|
@@ -2296,11 +2272,11 @@ var require_cjs3 = __commonJS({
|
|
|
2296
2272
|
var joinArrays = (...arrays) => {
|
|
2297
2273
|
return [].concat(...arrays);
|
|
2298
2274
|
};
|
|
2299
|
-
var mergeArray = (arr,
|
|
2300
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
2275
|
+
var mergeArray = (arr, exclude = []) => {
|
|
2276
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
2301
2277
|
};
|
|
2302
2278
|
var mergeAndCloneIfArray = (obj) => {
|
|
2303
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
2279
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
2304
2280
|
};
|
|
2305
2281
|
var cutArrayBeforeValue = (arr, value) => {
|
|
2306
2282
|
const index = arr.indexOf(value);
|
|
@@ -2545,8 +2521,6 @@ var require_cjs3 = __commonJS({
|
|
|
2545
2521
|
createNestedObject: () => createNestedObject,
|
|
2546
2522
|
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
2547
2523
|
deepClone: () => deepClone2,
|
|
2548
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
2549
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
2550
2524
|
deepContains: () => deepContains,
|
|
2551
2525
|
deepDestringify: () => deepDestringify,
|
|
2552
2526
|
deepDiff: () => deepDiff,
|
|
@@ -2640,78 +2614,56 @@ var require_cjs3 = __commonJS({
|
|
|
2640
2614
|
}
|
|
2641
2615
|
return o;
|
|
2642
2616
|
};
|
|
2643
|
-
var
|
|
2644
|
-
|
|
2645
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2646
|
-
}
|
|
2647
|
-
const o = {};
|
|
2648
|
-
for (const k in obj) {
|
|
2649
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
2650
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
2651
|
-
continue;
|
|
2652
|
-
let v = obj[k];
|
|
2653
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
2654
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
2655
|
-
}
|
|
2656
|
-
if ((0, import_types.isArray)(v)) {
|
|
2657
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2658
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
2659
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
2660
|
-
} else
|
|
2661
|
-
o[k] = v;
|
|
2662
|
-
}
|
|
2663
|
-
return o;
|
|
2664
|
-
};
|
|
2665
|
-
var mergeArrayExclude = (arr, excl = []) => {
|
|
2666
|
-
return arr.reduce((acc, curr) => deepMerge3(acc, deepCloneExclude(curr, excl)), {});
|
|
2617
|
+
var mergeArrayExclude = (arr, exclude = []) => {
|
|
2618
|
+
return arr.reduce((acc, curr) => deepMerge3(acc, deepClone2(curr, { exclude })), {});
|
|
2667
2619
|
};
|
|
2668
|
-
var deepClone2 = (obj,
|
|
2669
|
-
|
|
2620
|
+
var deepClone2 = (obj, options = {}) => {
|
|
2621
|
+
const {
|
|
2622
|
+
exclude = [],
|
|
2623
|
+
cleanUndefined = false,
|
|
2624
|
+
cleanNull = false,
|
|
2625
|
+
window: targetWindow,
|
|
2626
|
+
visited = /* @__PURE__ */ new WeakMap(),
|
|
2627
|
+
handleExtend = false
|
|
2628
|
+
} = options;
|
|
2629
|
+
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
2670
2630
|
return obj;
|
|
2671
|
-
|
|
2631
|
+
}
|
|
2632
|
+
if (visited.has(obj)) {
|
|
2672
2633
|
return visited.get(obj);
|
|
2673
|
-
|
|
2634
|
+
}
|
|
2635
|
+
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
2674
2636
|
visited.set(obj, clone2);
|
|
2675
2637
|
for (const key in obj) {
|
|
2676
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
}
|
|
2687
|
-
}
|
|
2688
|
-
}
|
|
2689
|
-
return clone2;
|
|
2690
|
-
};
|
|
2691
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
2692
|
-
if ((0, import_types.isObjectLike)(obj)) {
|
|
2693
|
-
if (visited.has(obj)) {
|
|
2694
|
-
return obj;
|
|
2638
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
2639
|
+
continue;
|
|
2640
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
2641
|
+
continue;
|
|
2642
|
+
const value = obj[key];
|
|
2643
|
+
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
2644
|
+
continue;
|
|
2645
|
+
if ((0, import_node.isDOMNode)(value)) {
|
|
2646
|
+
clone2[key] = value;
|
|
2647
|
+
continue;
|
|
2695
2648
|
}
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
2699
|
-
for (const prop in obj) {
|
|
2700
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2649
|
+
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
2650
|
+
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
2701
2651
|
continue;
|
|
2702
|
-
|
|
2703
|
-
if (
|
|
2652
|
+
}
|
|
2653
|
+
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
2654
|
+
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
2704
2655
|
continue;
|
|
2705
2656
|
}
|
|
2706
|
-
if ((0, import_types.isObjectLike)(
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2657
|
+
if ((0, import_types.isObjectLike)(value)) {
|
|
2658
|
+
clone2[key] = deepClone2(value, {
|
|
2659
|
+
...options,
|
|
2660
|
+
visited
|
|
2661
|
+
});
|
|
2710
2662
|
} else {
|
|
2711
|
-
|
|
2663
|
+
clone2[key] = value;
|
|
2712
2664
|
}
|
|
2713
2665
|
}
|
|
2714
|
-
return
|
|
2666
|
+
return clone2;
|
|
2715
2667
|
};
|
|
2716
2668
|
var deepStringify = (obj, stringified = {}) => {
|
|
2717
2669
|
var _a, _b;
|
|
@@ -3720,7 +3672,7 @@ var require_cjs3 = __commonJS({
|
|
|
3720
3672
|
if (newChild === null)
|
|
3721
3673
|
assignChild(null);
|
|
3722
3674
|
else if (!childElem)
|
|
3723
|
-
assignChild((0, import__.
|
|
3675
|
+
assignChild((0, import__.deepClone)(newChild));
|
|
3724
3676
|
else {
|
|
3725
3677
|
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
3726
3678
|
if (isSugarChildElem)
|
package/dist/cjs/system/reset.js
CHANGED
|
@@ -346,11 +346,11 @@ var require_array = __commonJS({
|
|
|
346
346
|
var joinArrays = (...arrays) => {
|
|
347
347
|
return [].concat(...arrays);
|
|
348
348
|
};
|
|
349
|
-
var mergeArray = (arr,
|
|
350
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
349
|
+
var mergeArray = (arr, exclude = []) => {
|
|
350
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
351
351
|
};
|
|
352
352
|
var mergeAndCloneIfArray = (obj) => {
|
|
353
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
353
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
354
354
|
};
|
|
355
355
|
var cutArrayBeforeValue = (arr, value) => {
|
|
356
356
|
const index = arr.indexOf(value);
|
|
@@ -599,8 +599,6 @@ var require_object = __commonJS({
|
|
|
599
599
|
createNestedObject: () => createNestedObject,
|
|
600
600
|
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
601
601
|
deepClone: () => deepClone2,
|
|
602
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
603
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
604
602
|
deepContains: () => deepContains,
|
|
605
603
|
deepDestringify: () => deepDestringify,
|
|
606
604
|
deepDiff: () => deepDiff,
|
|
@@ -694,78 +692,56 @@ var require_object = __commonJS({
|
|
|
694
692
|
}
|
|
695
693
|
return o;
|
|
696
694
|
};
|
|
697
|
-
var
|
|
698
|
-
|
|
699
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
700
|
-
}
|
|
701
|
-
const o = {};
|
|
702
|
-
for (const k in obj) {
|
|
703
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
704
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
705
|
-
continue;
|
|
706
|
-
let v = obj[k];
|
|
707
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
708
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
709
|
-
}
|
|
710
|
-
if ((0, import_types.isArray)(v)) {
|
|
711
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
712
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
713
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
714
|
-
} else
|
|
715
|
-
o[k] = v;
|
|
716
|
-
}
|
|
717
|
-
return o;
|
|
695
|
+
var mergeArrayExclude = (arr, exclude = []) => {
|
|
696
|
+
return arr.reduce((acc, curr) => deepMerge3(acc, deepClone2(curr, { exclude })), {});
|
|
718
697
|
};
|
|
719
|
-
var
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
698
|
+
var deepClone2 = (obj, options = {}) => {
|
|
699
|
+
const {
|
|
700
|
+
exclude = [],
|
|
701
|
+
cleanUndefined = false,
|
|
702
|
+
cleanNull = false,
|
|
703
|
+
window: targetWindow,
|
|
704
|
+
visited = /* @__PURE__ */ new WeakMap(),
|
|
705
|
+
handleExtend = false
|
|
706
|
+
} = options;
|
|
707
|
+
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
724
708
|
return obj;
|
|
725
|
-
|
|
709
|
+
}
|
|
710
|
+
if (visited.has(obj)) {
|
|
726
711
|
return visited.get(obj);
|
|
727
|
-
|
|
712
|
+
}
|
|
713
|
+
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
728
714
|
visited.set(obj, clone2);
|
|
729
715
|
for (const key in obj) {
|
|
730
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
return clone2;
|
|
744
|
-
};
|
|
745
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
746
|
-
if ((0, import_types.isObjectLike)(obj)) {
|
|
747
|
-
if (visited.has(obj)) {
|
|
748
|
-
return obj;
|
|
716
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
717
|
+
continue;
|
|
718
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
719
|
+
continue;
|
|
720
|
+
const value = obj[key];
|
|
721
|
+
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
722
|
+
continue;
|
|
723
|
+
if ((0, import_node.isDOMNode)(value)) {
|
|
724
|
+
clone2[key] = value;
|
|
725
|
+
continue;
|
|
749
726
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
753
|
-
for (const prop in obj) {
|
|
754
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
727
|
+
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
728
|
+
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
755
729
|
continue;
|
|
756
|
-
|
|
757
|
-
if (
|
|
730
|
+
}
|
|
731
|
+
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
732
|
+
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
758
733
|
continue;
|
|
759
734
|
}
|
|
760
|
-
if ((0, import_types.isObjectLike)(
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
735
|
+
if ((0, import_types.isObjectLike)(value)) {
|
|
736
|
+
clone2[key] = deepClone2(value, {
|
|
737
|
+
...options,
|
|
738
|
+
visited
|
|
739
|
+
});
|
|
764
740
|
} else {
|
|
765
|
-
|
|
741
|
+
clone2[key] = value;
|
|
766
742
|
}
|
|
767
743
|
}
|
|
768
|
-
return
|
|
744
|
+
return clone2;
|
|
769
745
|
};
|
|
770
746
|
var deepStringify = (obj, stringified = {}) => {
|
|
771
747
|
var _a, _b;
|
|
@@ -1784,7 +1760,7 @@ var require_component = __commonJS({
|
|
|
1784
1760
|
if (newChild === null)
|
|
1785
1761
|
assignChild(null);
|
|
1786
1762
|
else if (!childElem)
|
|
1787
|
-
assignChild((0, import__.
|
|
1763
|
+
assignChild((0, import__.deepClone)(newChild));
|
|
1788
1764
|
else {
|
|
1789
1765
|
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
1790
1766
|
if (isSugarChildElem)
|
|
@@ -2296,11 +2272,11 @@ var require_cjs3 = __commonJS({
|
|
|
2296
2272
|
var joinArrays = (...arrays) => {
|
|
2297
2273
|
return [].concat(...arrays);
|
|
2298
2274
|
};
|
|
2299
|
-
var mergeArray = (arr,
|
|
2300
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
2275
|
+
var mergeArray = (arr, exclude = []) => {
|
|
2276
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
2301
2277
|
};
|
|
2302
2278
|
var mergeAndCloneIfArray = (obj) => {
|
|
2303
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
2279
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
2304
2280
|
};
|
|
2305
2281
|
var cutArrayBeforeValue = (arr, value) => {
|
|
2306
2282
|
const index = arr.indexOf(value);
|
|
@@ -2545,8 +2521,6 @@ var require_cjs3 = __commonJS({
|
|
|
2545
2521
|
createNestedObject: () => createNestedObject,
|
|
2546
2522
|
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
2547
2523
|
deepClone: () => deepClone2,
|
|
2548
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
2549
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
2550
2524
|
deepContains: () => deepContains,
|
|
2551
2525
|
deepDestringify: () => deepDestringify,
|
|
2552
2526
|
deepDiff: () => deepDiff,
|
|
@@ -2640,78 +2614,56 @@ var require_cjs3 = __commonJS({
|
|
|
2640
2614
|
}
|
|
2641
2615
|
return o;
|
|
2642
2616
|
};
|
|
2643
|
-
var
|
|
2644
|
-
|
|
2645
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2646
|
-
}
|
|
2647
|
-
const o = {};
|
|
2648
|
-
for (const k in obj) {
|
|
2649
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
2650
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
2651
|
-
continue;
|
|
2652
|
-
let v = obj[k];
|
|
2653
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
2654
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
2655
|
-
}
|
|
2656
|
-
if ((0, import_types.isArray)(v)) {
|
|
2657
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2658
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
2659
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
2660
|
-
} else
|
|
2661
|
-
o[k] = v;
|
|
2662
|
-
}
|
|
2663
|
-
return o;
|
|
2664
|
-
};
|
|
2665
|
-
var mergeArrayExclude = (arr, excl = []) => {
|
|
2666
|
-
return arr.reduce((acc, curr) => deepMerge3(acc, deepCloneExclude(curr, excl)), {});
|
|
2617
|
+
var mergeArrayExclude = (arr, exclude = []) => {
|
|
2618
|
+
return arr.reduce((acc, curr) => deepMerge3(acc, deepClone2(curr, { exclude })), {});
|
|
2667
2619
|
};
|
|
2668
|
-
var deepClone2 = (obj,
|
|
2669
|
-
|
|
2620
|
+
var deepClone2 = (obj, options = {}) => {
|
|
2621
|
+
const {
|
|
2622
|
+
exclude = [],
|
|
2623
|
+
cleanUndefined = false,
|
|
2624
|
+
cleanNull = false,
|
|
2625
|
+
window: targetWindow,
|
|
2626
|
+
visited = /* @__PURE__ */ new WeakMap(),
|
|
2627
|
+
handleExtend = false
|
|
2628
|
+
} = options;
|
|
2629
|
+
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
2670
2630
|
return obj;
|
|
2671
|
-
|
|
2631
|
+
}
|
|
2632
|
+
if (visited.has(obj)) {
|
|
2672
2633
|
return visited.get(obj);
|
|
2673
|
-
|
|
2634
|
+
}
|
|
2635
|
+
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
2674
2636
|
visited.set(obj, clone2);
|
|
2675
2637
|
for (const key in obj) {
|
|
2676
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
}
|
|
2687
|
-
}
|
|
2688
|
-
}
|
|
2689
|
-
return clone2;
|
|
2690
|
-
};
|
|
2691
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
2692
|
-
if ((0, import_types.isObjectLike)(obj)) {
|
|
2693
|
-
if (visited.has(obj)) {
|
|
2694
|
-
return obj;
|
|
2638
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
2639
|
+
continue;
|
|
2640
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
2641
|
+
continue;
|
|
2642
|
+
const value = obj[key];
|
|
2643
|
+
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
2644
|
+
continue;
|
|
2645
|
+
if ((0, import_node.isDOMNode)(value)) {
|
|
2646
|
+
clone2[key] = value;
|
|
2647
|
+
continue;
|
|
2695
2648
|
}
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
2699
|
-
for (const prop in obj) {
|
|
2700
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2649
|
+
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
2650
|
+
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
2701
2651
|
continue;
|
|
2702
|
-
|
|
2703
|
-
if (
|
|
2652
|
+
}
|
|
2653
|
+
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
2654
|
+
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
2704
2655
|
continue;
|
|
2705
2656
|
}
|
|
2706
|
-
if ((0, import_types.isObjectLike)(
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2657
|
+
if ((0, import_types.isObjectLike)(value)) {
|
|
2658
|
+
clone2[key] = deepClone2(value, {
|
|
2659
|
+
...options,
|
|
2660
|
+
visited
|
|
2661
|
+
});
|
|
2710
2662
|
} else {
|
|
2711
|
-
|
|
2663
|
+
clone2[key] = value;
|
|
2712
2664
|
}
|
|
2713
2665
|
}
|
|
2714
|
-
return
|
|
2666
|
+
return clone2;
|
|
2715
2667
|
};
|
|
2716
2668
|
var deepStringify = (obj, stringified = {}) => {
|
|
2717
2669
|
var _a, _b;
|
|
@@ -3720,7 +3672,7 @@ var require_cjs3 = __commonJS({
|
|
|
3720
3672
|
if (newChild === null)
|
|
3721
3673
|
assignChild(null);
|
|
3722
3674
|
else if (!childElem)
|
|
3723
|
-
assignChild((0, import__.
|
|
3675
|
+
assignChild((0, import__.deepClone)(newChild));
|
|
3724
3676
|
else {
|
|
3725
3677
|
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
3726
3678
|
if (isSugarChildElem)
|