@symbo.ls/scratch 2.11.410 → 2.11.429

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.
@@ -342,10 +342,10 @@ var require_array = __commonJS({
342
342
  return [].concat(...arrays);
343
343
  };
344
344
  var mergeArray = (arr, excludeFrom = []) => {
345
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
345
+ return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepCloneWithExtend)(c, excludeFrom), excludeFrom), {});
346
346
  };
347
347
  var mergeAndCloneIfArray = (obj) => {
348
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
348
+ return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepCloneWithExtend)(obj);
349
349
  };
350
350
  var cutArrayBeforeValue = (arr, value) => {
351
351
  const index = arr.indexOf(value);
@@ -451,6 +451,8 @@ var require_string = __commonJS({
451
451
  __export2(string_exports, {
452
452
  customDecodeURIComponent: () => customDecodeURIComponent,
453
453
  customEncodeURIComponent: () => customEncodeURIComponent,
454
+ decodeNewlines: () => decodeNewlines,
455
+ encodeNewlines: () => encodeNewlines,
454
456
  findKeyPosition: () => findKeyPosition,
455
457
  lowercaseFirstLetter: () => lowercaseFirstLetter,
456
458
  replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
@@ -554,6 +556,12 @@ var require_string = __commonJS({
554
556
  return char;
555
557
  });
556
558
  };
559
+ var encodeNewlines = (str) => {
560
+ return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
561
+ };
562
+ var decodeNewlines = (encodedStr) => {
563
+ return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
564
+ };
557
565
  var customEncodeURIComponent = (str) => {
558
566
  return str.split("").map((char) => {
559
567
  if (/[^a-zA-Z0-9\s]/.test(char)) {
@@ -732,7 +740,7 @@ var require_object = __commonJS({
732
740
  return o;
733
741
  };
734
742
  var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
735
- const o = (0, import_types.isArray)(obj) ? [] : {};
743
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
736
744
  for (const prop in obj) {
737
745
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
738
746
  continue;
@@ -986,7 +994,7 @@ var require_object = __commonJS({
986
994
  };
987
995
  var overwriteDeep = (obj, params, excludeFrom = []) => {
988
996
  for (const e in params) {
989
- if (e === "__proto__")
997
+ if (e === "__ref")
990
998
  continue;
991
999
  if (excludeFrom.includes(e) || e.startsWith("__"))
992
1000
  continue;
@@ -1108,6 +1116,12 @@ var require_object = __commonJS({
1108
1116
  if (foundString || foundInArray)
1109
1117
  return el;
1110
1118
  }
1119
+ if (el.parent && el.parent.childExtend) {
1120
+ const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
1121
+ const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
1122
+ if (foundString || foundInArray)
1123
+ return el;
1124
+ }
1111
1125
  };
1112
1126
  var getExtendsInElement = (obj) => {
1113
1127
  let result = [];