@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
|
@@ -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) => deepMerge2(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) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
|
|
2617
|
+
var mergeArrayExclude = (arr, exclude = []) => {
|
|
2618
|
+
return arr.reduce((acc, curr) => deepMerge2(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)
|
|
@@ -369,11 +369,11 @@ var require_cjs = __commonJS({
|
|
|
369
369
|
var joinArrays = (...arrays) => {
|
|
370
370
|
return [].concat(...arrays);
|
|
371
371
|
};
|
|
372
|
-
var mergeArray = (arr,
|
|
373
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
372
|
+
var mergeArray = (arr, exclude = []) => {
|
|
373
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
374
374
|
};
|
|
375
375
|
var mergeAndCloneIfArray = (obj) => {
|
|
376
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
376
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
377
377
|
};
|
|
378
378
|
var cutArrayBeforeValue = (arr, value) => {
|
|
379
379
|
const index = arr.indexOf(value);
|
|
@@ -618,8 +618,6 @@ var require_cjs = __commonJS({
|
|
|
618
618
|
createNestedObject: () => createNestedObject,
|
|
619
619
|
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
620
620
|
deepClone: () => deepClone2,
|
|
621
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
622
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
623
621
|
deepContains: () => deepContains,
|
|
624
622
|
deepDestringify: () => deepDestringify,
|
|
625
623
|
deepDiff: () => deepDiff,
|
|
@@ -713,78 +711,56 @@ var require_cjs = __commonJS({
|
|
|
713
711
|
}
|
|
714
712
|
return o;
|
|
715
713
|
};
|
|
716
|
-
var
|
|
717
|
-
|
|
718
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
719
|
-
}
|
|
720
|
-
const o = {};
|
|
721
|
-
for (const k in obj) {
|
|
722
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
723
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
724
|
-
continue;
|
|
725
|
-
let v = obj[k];
|
|
726
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
727
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
728
|
-
}
|
|
729
|
-
if ((0, import_types.isArray)(v)) {
|
|
730
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
731
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
732
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
733
|
-
} else
|
|
734
|
-
o[k] = v;
|
|
735
|
-
}
|
|
736
|
-
return o;
|
|
714
|
+
var mergeArrayExclude = (arr, exclude = []) => {
|
|
715
|
+
return arr.reduce((acc, curr) => deepMerge2(acc, deepClone2(curr, { exclude })), {});
|
|
737
716
|
};
|
|
738
|
-
var
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
717
|
+
var deepClone2 = (obj, options = {}) => {
|
|
718
|
+
const {
|
|
719
|
+
exclude = [],
|
|
720
|
+
cleanUndefined = false,
|
|
721
|
+
cleanNull = false,
|
|
722
|
+
window: targetWindow,
|
|
723
|
+
visited = /* @__PURE__ */ new WeakMap(),
|
|
724
|
+
handleExtend = false
|
|
725
|
+
} = options;
|
|
726
|
+
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
743
727
|
return obj;
|
|
744
|
-
|
|
728
|
+
}
|
|
729
|
+
if (visited.has(obj)) {
|
|
745
730
|
return visited.get(obj);
|
|
746
|
-
|
|
731
|
+
}
|
|
732
|
+
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
747
733
|
visited.set(obj, clone2);
|
|
748
734
|
for (const key in obj) {
|
|
749
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
return clone2;
|
|
763
|
-
};
|
|
764
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
765
|
-
if ((0, import_types.isObjectLike)(obj)) {
|
|
766
|
-
if (visited.has(obj)) {
|
|
767
|
-
return obj;
|
|
735
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
736
|
+
continue;
|
|
737
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
738
|
+
continue;
|
|
739
|
+
const value = obj[key];
|
|
740
|
+
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
741
|
+
continue;
|
|
742
|
+
if ((0, import_node.isDOMNode)(value)) {
|
|
743
|
+
clone2[key] = value;
|
|
744
|
+
continue;
|
|
768
745
|
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
772
|
-
for (const prop in obj) {
|
|
773
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
746
|
+
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
747
|
+
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
774
748
|
continue;
|
|
775
|
-
|
|
776
|
-
if (
|
|
749
|
+
}
|
|
750
|
+
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
751
|
+
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
777
752
|
continue;
|
|
778
753
|
}
|
|
779
|
-
if ((0, import_types.isObjectLike)(
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
754
|
+
if ((0, import_types.isObjectLike)(value)) {
|
|
755
|
+
clone2[key] = deepClone2(value, {
|
|
756
|
+
...options,
|
|
757
|
+
visited
|
|
758
|
+
});
|
|
783
759
|
} else {
|
|
784
|
-
|
|
760
|
+
clone2[key] = value;
|
|
785
761
|
}
|
|
786
762
|
}
|
|
787
|
-
return
|
|
763
|
+
return clone2;
|
|
788
764
|
};
|
|
789
765
|
var deepStringify = (obj, stringified = {}) => {
|
|
790
766
|
var _a, _b;
|
|
@@ -1793,7 +1769,7 @@ var require_cjs = __commonJS({
|
|
|
1793
1769
|
if (newChild === null)
|
|
1794
1770
|
assignChild(null);
|
|
1795
1771
|
else if (!childElem)
|
|
1796
|
-
assignChild((0, import__.
|
|
1772
|
+
assignChild((0, import__.deepClone)(newChild));
|
|
1797
1773
|
else {
|
|
1798
1774
|
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
1799
1775
|
if (isSugarChildElem)
|
|
@@ -2454,11 +2430,11 @@ var require_array = __commonJS({
|
|
|
2454
2430
|
var joinArrays = (...arrays) => {
|
|
2455
2431
|
return [].concat(...arrays);
|
|
2456
2432
|
};
|
|
2457
|
-
var mergeArray = (arr,
|
|
2458
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
2433
|
+
var mergeArray = (arr, exclude = []) => {
|
|
2434
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
2459
2435
|
};
|
|
2460
2436
|
var mergeAndCloneIfArray = (obj) => {
|
|
2461
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
2437
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
2462
2438
|
};
|
|
2463
2439
|
var cutArrayBeforeValue = (arr, value) => {
|
|
2464
2440
|
const index = arr.indexOf(value);
|
|
@@ -2707,8 +2683,6 @@ var require_object = __commonJS({
|
|
|
2707
2683
|
createNestedObject: () => createNestedObject,
|
|
2708
2684
|
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
2709
2685
|
deepClone: () => deepClone2,
|
|
2710
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
2711
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
2712
2686
|
deepContains: () => deepContains,
|
|
2713
2687
|
deepDestringify: () => deepDestringify,
|
|
2714
2688
|
deepDiff: () => deepDiff,
|
|
@@ -2802,78 +2776,56 @@ var require_object = __commonJS({
|
|
|
2802
2776
|
}
|
|
2803
2777
|
return o;
|
|
2804
2778
|
};
|
|
2805
|
-
var
|
|
2806
|
-
|
|
2807
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2808
|
-
}
|
|
2809
|
-
const o = {};
|
|
2810
|
-
for (const k in obj) {
|
|
2811
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
2812
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
2813
|
-
continue;
|
|
2814
|
-
let v = obj[k];
|
|
2815
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
2816
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
2817
|
-
}
|
|
2818
|
-
if ((0, import_types.isArray)(v)) {
|
|
2819
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2820
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
2821
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
2822
|
-
} else
|
|
2823
|
-
o[k] = v;
|
|
2824
|
-
}
|
|
2825
|
-
return o;
|
|
2826
|
-
};
|
|
2827
|
-
var mergeArrayExclude = (arr, excl = []) => {
|
|
2828
|
-
return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
|
|
2779
|
+
var mergeArrayExclude = (arr, exclude = []) => {
|
|
2780
|
+
return arr.reduce((acc, curr) => deepMerge2(acc, deepClone2(curr, { exclude })), {});
|
|
2829
2781
|
};
|
|
2830
|
-
var deepClone2 = (obj,
|
|
2831
|
-
|
|
2782
|
+
var deepClone2 = (obj, options = {}) => {
|
|
2783
|
+
const {
|
|
2784
|
+
exclude = [],
|
|
2785
|
+
cleanUndefined = false,
|
|
2786
|
+
cleanNull = false,
|
|
2787
|
+
window: targetWindow,
|
|
2788
|
+
visited = /* @__PURE__ */ new WeakMap(),
|
|
2789
|
+
handleExtend = false
|
|
2790
|
+
} = options;
|
|
2791
|
+
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
2832
2792
|
return obj;
|
|
2833
|
-
|
|
2793
|
+
}
|
|
2794
|
+
if (visited.has(obj)) {
|
|
2834
2795
|
return visited.get(obj);
|
|
2835
|
-
|
|
2796
|
+
}
|
|
2797
|
+
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
2836
2798
|
visited.set(obj, clone2);
|
|
2837
2799
|
for (const key in obj) {
|
|
2838
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
}
|
|
2849
|
-
}
|
|
2850
|
-
}
|
|
2851
|
-
return clone2;
|
|
2852
|
-
};
|
|
2853
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
2854
|
-
if ((0, import_types.isObjectLike)(obj)) {
|
|
2855
|
-
if (visited.has(obj)) {
|
|
2856
|
-
return obj;
|
|
2800
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
2801
|
+
continue;
|
|
2802
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
2803
|
+
continue;
|
|
2804
|
+
const value = obj[key];
|
|
2805
|
+
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
2806
|
+
continue;
|
|
2807
|
+
if ((0, import_node.isDOMNode)(value)) {
|
|
2808
|
+
clone2[key] = value;
|
|
2809
|
+
continue;
|
|
2857
2810
|
}
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
2861
|
-
for (const prop in obj) {
|
|
2862
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2811
|
+
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
2812
|
+
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
2863
2813
|
continue;
|
|
2864
|
-
|
|
2865
|
-
if (
|
|
2814
|
+
}
|
|
2815
|
+
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
2816
|
+
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
2866
2817
|
continue;
|
|
2867
2818
|
}
|
|
2868
|
-
if ((0, import_types.isObjectLike)(
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2819
|
+
if ((0, import_types.isObjectLike)(value)) {
|
|
2820
|
+
clone2[key] = deepClone2(value, {
|
|
2821
|
+
...options,
|
|
2822
|
+
visited
|
|
2823
|
+
});
|
|
2872
2824
|
} else {
|
|
2873
|
-
|
|
2825
|
+
clone2[key] = value;
|
|
2874
2826
|
}
|
|
2875
2827
|
}
|
|
2876
|
-
return
|
|
2828
|
+
return clone2;
|
|
2877
2829
|
};
|
|
2878
2830
|
var deepStringify = (obj, stringified = {}) => {
|
|
2879
2831
|
var _a, _b;
|
|
@@ -3892,7 +3844,7 @@ var require_component = __commonJS({
|
|
|
3892
3844
|
if (newChild === null)
|
|
3893
3845
|
assignChild(null);
|
|
3894
3846
|
else if (!childElem)
|
|
3895
|
-
assignChild((0, import__.
|
|
3847
|
+
assignChild((0, import__.deepClone)(newChild));
|
|
3896
3848
|
else {
|
|
3897
3849
|
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
3898
3850
|
if (isSugarChildElem)
|