@symbo.ls/scratch 2.11.200 → 2.11.212

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/index.js CHANGED
@@ -66,9 +66,9 @@ var require_cjs = __commonJS({
66
66
  }
67
67
  });
68
68
 
69
- // ../../node_modules/@domql/utils/dist/cjs/key.js
69
+ // ../../../domql/packages/utils/dist/cjs/key.js
70
70
  var require_key = __commonJS({
71
- "../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
71
+ "../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
72
72
  "use strict";
73
73
  var __defProp2 = Object.defineProperty;
74
74
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -105,9 +105,9 @@ var require_key = __commonJS({
105
105
  }
106
106
  });
107
107
 
108
- // ../../node_modules/@domql/utils/dist/cjs/env.js
108
+ // ../../../domql/packages/utils/dist/cjs/env.js
109
109
  var require_env = __commonJS({
110
- "../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
110
+ "../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
111
111
  "use strict";
112
112
  var __defProp2 = Object.defineProperty;
113
113
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -143,9 +143,9 @@ var require_env = __commonJS({
143
143
  }
144
144
  });
145
145
 
146
- // ../../node_modules/@domql/utils/dist/cjs/globals.js
146
+ // ../../../domql/packages/utils/dist/cjs/globals.js
147
147
  var require_globals = __commonJS({
148
- "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
148
+ "../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
149
149
  "use strict";
150
150
  var __defProp2 = Object.defineProperty;
151
151
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -179,9 +179,9 @@ var require_globals = __commonJS({
179
179
  }
180
180
  });
181
181
 
182
- // ../../node_modules/@domql/utils/dist/cjs/node.js
182
+ // ../../../domql/packages/utils/dist/cjs/node.js
183
183
  var require_node = __commonJS({
184
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
184
+ "../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
185
185
  "use strict";
186
186
  var __defProp2 = Object.defineProperty;
187
187
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -216,9 +216,9 @@ var require_node = __commonJS({
216
216
  }
217
217
  });
218
218
 
219
- // ../../node_modules/@domql/utils/dist/cjs/types.js
219
+ // ../../../domql/packages/utils/dist/cjs/types.js
220
220
  var require_types = __commonJS({
221
- "../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
221
+ "../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
222
222
  "use strict";
223
223
  var __defProp2 = Object.defineProperty;
224
224
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -303,9 +303,9 @@ var require_types = __commonJS({
303
303
  }
304
304
  });
305
305
 
306
- // ../../node_modules/@domql/utils/dist/cjs/array.js
306
+ // ../../../domql/packages/utils/dist/cjs/array.js
307
307
  var require_array = __commonJS({
308
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
308
+ "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
309
309
  "use strict";
310
310
  var __defProp2 = Object.defineProperty;
311
311
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -402,9 +402,9 @@ var require_array = __commonJS({
402
402
  }
403
403
  });
404
404
 
405
- // ../../node_modules/@domql/utils/dist/cjs/string.js
405
+ // ../../../domql/packages/utils/dist/cjs/string.js
406
406
  var require_string = __commonJS({
407
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
407
+ "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
408
408
  "use strict";
409
409
  var __defProp2 = Object.defineProperty;
410
410
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -462,9 +462,9 @@ var require_string = __commonJS({
462
462
  }
463
463
  });
464
464
 
465
- // ../../node_modules/@domql/utils/dist/cjs/object.js
465
+ // ../../../domql/packages/utils/dist/cjs/object.js
466
466
  var require_object = __commonJS({
467
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
467
+ "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
468
468
  "use strict";
469
469
  var __defProp2 = Object.defineProperty;
470
470
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -488,6 +488,7 @@ var require_object = __commonJS({
488
488
  clone: () => clone,
489
489
  deepClone: () => deepClone2,
490
490
  deepCloneExclude: () => deepCloneExclude,
491
+ deepContains: () => deepContains,
491
492
  deepDestringify: () => deepDestringify,
492
493
  deepMerge: () => deepMerge3,
493
494
  deepStringify: () => deepStringify,
@@ -550,7 +551,7 @@ var require_object = __commonJS({
550
551
  const elementProp = element[e];
551
552
  const extendProp = extend[e];
552
553
  if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
553
- deepMerge3(elementProp, extendProp);
554
+ deepMerge3(elementProp, extendProp, excludeFrom);
554
555
  } else if (elementProp === void 0) {
555
556
  element[e] = extendProp;
556
557
  }
@@ -640,8 +641,8 @@ var require_object = __commonJS({
640
641
  const spaces = " ".repeat(indent);
641
642
  let str = "{\n";
642
643
  for (const [key, value] of Object.entries(obj)) {
643
- const keyAllowdChars = (0, import_string.stringIncludesAny)(key, ["-", ":", "@", ".", "!"]);
644
- const stringedKey = keyAllowdChars ? `'${key}'` : key;
644
+ const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["-", ":", "@", ".", "/", "!"]);
645
+ const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
645
646
  str += `${spaces} ${stringedKey}: `;
646
647
  if ((0, import_types.isArray)(value)) {
647
648
  str += "[\n";
@@ -696,7 +697,7 @@ var require_object = __commonJS({
696
697
  }
697
698
  return detached;
698
699
  };
699
- var deepDestringify = (obj, stringified = {}) => {
700
+ var deepDestringify = (obj, destringified = {}) => {
700
701
  for (const prop in obj) {
701
702
  const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
702
703
  if (!hasOwnProperty)
@@ -706,52 +707,50 @@ var require_object = __commonJS({
706
707
  if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
707
708
  try {
708
709
  const evalProp = import_globals3.window.eval(`(${objProp})`);
709
- stringified[prop] = evalProp;
710
+ destringified[prop] = evalProp;
710
711
  } catch (e) {
711
712
  if (e)
712
- stringified[prop] = objProp;
713
+ destringified[prop] = objProp;
713
714
  }
714
715
  } else {
715
- stringified[prop] = objProp;
716
+ destringified[prop] = objProp;
716
717
  }
717
718
  } else if ((0, import_types.isArray)(objProp)) {
718
- stringified[prop] = [];
719
+ destringified[prop] = [];
719
720
  objProp.forEach((arrProp) => {
720
721
  if ((0, import_types.isString)(arrProp)) {
721
722
  if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
722
723
  try {
723
724
  const evalProp = import_globals3.window.eval(`(${arrProp})`);
724
- stringified[prop].push(evalProp);
725
+ destringified[prop].push(evalProp);
725
726
  } catch (e) {
726
727
  if (e)
727
- stringified[prop].push(arrProp);
728
+ destringified[prop].push(arrProp);
728
729
  }
729
730
  } else {
730
- stringified[prop].push(arrProp);
731
+ destringified[prop].push(arrProp);
731
732
  }
732
733
  } else if ((0, import_types.isObject)(arrProp)) {
733
- stringified[prop].push(deepDestringify(arrProp));
734
+ destringified[prop].push(deepDestringify(arrProp));
734
735
  } else {
735
- stringified[prop].push(arrProp);
736
+ destringified[prop].push(arrProp);
736
737
  }
737
738
  });
738
739
  } else if ((0, import_types.isObject)(objProp)) {
739
- stringified[prop] = deepDestringify(objProp, stringified[prop]);
740
+ destringified[prop] = deepDestringify(objProp, destringified[prop]);
740
741
  } else {
741
- stringified[prop] = objProp;
742
+ destringified[prop] = objProp;
742
743
  }
743
744
  }
744
- return stringified;
745
+ return destringified;
745
746
  };
746
- var stringToObject = (str) => {
747
- let obj;
747
+ var stringToObject = (str, verbose) => {
748
748
  try {
749
- obj = import_globals3.window.eval("(" + str + ")");
749
+ return import_globals3.window.eval("(" + str + ")");
750
750
  } catch (e) {
751
- console.warn(e);
751
+ if (verbose)
752
+ console.warn(e);
752
753
  }
753
- if (obj)
754
- return obj;
755
754
  };
756
755
  var diffObjects = (original, objToDiff, cache) => {
757
756
  for (const e in objToDiff) {
@@ -847,23 +846,56 @@ var require_object = __commonJS({
847
846
  delete objectized[prop];
848
847
  return stack;
849
848
  };
850
- var isEqualDeep = (param, element) => {
851
- if (param === element)
849
+ var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
850
+ if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
851
+ return param === element;
852
+ }
853
+ if (visited.has(param) || visited.has(element)) {
852
854
  return true;
853
- if (!param || !element)
855
+ }
856
+ visited.add(param);
857
+ visited.add(element);
858
+ const keysParam = Object.keys(param);
859
+ const keysElement = Object.keys(element);
860
+ if (keysParam.length !== keysElement.length) {
854
861
  return false;
855
- for (const prop in param) {
856
- const paramProp = param[prop];
857
- const elementProp = element[prop];
858
- if ((0, import_types.isObjectLike)(paramProp)) {
859
- const isEqual = isEqualDeep(paramProp, elementProp);
860
- if (!isEqual)
861
- return false;
862
- } else {
863
- const isEqual = paramProp === elementProp;
864
- if (!isEqual)
862
+ }
863
+ for (const key of keysParam) {
864
+ if (!keysElement.includes(key)) {
865
+ return false;
866
+ }
867
+ const paramProp = param[key];
868
+ const elementProp = element[key];
869
+ if (!isEqualDeep(paramProp, elementProp, visited)) {
870
+ return false;
871
+ }
872
+ }
873
+ return true;
874
+ };
875
+ var deepContains = (obj1, obj2) => {
876
+ if (typeof obj1 !== typeof obj2) {
877
+ return false;
878
+ }
879
+ if ((0, import_types.isObjectLike)(obj1)) {
880
+ if (Array.isArray(obj1) && Array.isArray(obj2)) {
881
+ if (obj1.length !== obj2.length) {
865
882
  return false;
883
+ }
884
+ for (let i = 0; i < obj1.length; i++) {
885
+ if (!deepContains(obj1[i], obj2[i])) {
886
+ return false;
887
+ }
888
+ }
889
+ } else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
890
+ for (const key in obj1) {
891
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj2, key);
892
+ if (!hasOwnProperty || !deepContains(obj1[key], obj2[key])) {
893
+ return false;
894
+ }
895
+ }
866
896
  }
897
+ } else {
898
+ return obj2 === obj1;
867
899
  }
868
900
  return true;
869
901
  };
@@ -882,9 +914,9 @@ var require_object = __commonJS({
882
914
  }
883
915
  });
884
916
 
885
- // ../../node_modules/@domql/utils/dist/cjs/function.js
917
+ // ../../../domql/packages/utils/dist/cjs/function.js
886
918
  var require_function = __commonJS({
887
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
919
+ "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
888
920
  "use strict";
889
921
  var __defProp2 = Object.defineProperty;
890
922
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -906,10 +938,29 @@ var require_function = __commonJS({
906
938
  var function_exports = {};
907
939
  __export2(function_exports, {
908
940
  debounce: () => debounce,
941
+ debounceOnContext: () => debounceOnContext,
942
+ isStringFunction: () => isStringFunction,
909
943
  memoize: () => memoize
910
944
  });
911
945
  module2.exports = __toCommonJS2(function_exports);
912
- var debounce = (element, func, timeout = 300) => {
946
+ function debounce(func, wait, immediate) {
947
+ let timeout;
948
+ return function() {
949
+ const context = this;
950
+ const args = arguments;
951
+ const later = function() {
952
+ timeout = null;
953
+ if (!immediate)
954
+ func.apply(context, args);
955
+ };
956
+ const callNow = immediate && !timeout;
957
+ clearTimeout(timeout);
958
+ timeout = setTimeout(later, wait);
959
+ if (callNow)
960
+ func.apply(context, args);
961
+ };
962
+ }
963
+ var debounceOnContext = (element, func, timeout = 300) => {
913
964
  let timer;
914
965
  return (...args) => {
915
966
  clearTimeout(timer);
@@ -931,12 +982,16 @@ var require_function = __commonJS({
931
982
  }
932
983
  };
933
984
  };
985
+ var isStringFunction = (inputString) => {
986
+ const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
987
+ return functionRegex.test(inputString);
988
+ };
934
989
  }
935
990
  });
936
991
 
937
- // ../../node_modules/@domql/utils/dist/cjs/log.js
992
+ // ../../../domql/packages/utils/dist/cjs/log.js
938
993
  var require_log = __commonJS({
939
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
994
+ "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
940
995
  "use strict";
941
996
  var __defProp2 = Object.defineProperty;
942
997
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -975,9 +1030,9 @@ var require_log = __commonJS({
975
1030
  }
976
1031
  });
977
1032
 
978
- // ../../node_modules/@domql/utils/dist/cjs/cookie.js
1033
+ // ../../../domql/packages/utils/dist/cjs/cookie.js
979
1034
  var require_cookie = __commonJS({
980
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
1035
+ "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
981
1036
  "use strict";
982
1037
  var __defProp2 = Object.defineProperty;
983
1038
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1031,9 +1086,9 @@ var require_cookie = __commonJS({
1031
1086
  }
1032
1087
  });
1033
1088
 
1034
- // ../../node_modules/@domql/utils/dist/cjs/tags.js
1089
+ // ../../../domql/packages/utils/dist/cjs/tags.js
1035
1090
  var require_tags = __commonJS({
1036
- "../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
1091
+ "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
1037
1092
  "use strict";
1038
1093
  var __defProp2 = Object.defineProperty;
1039
1094
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1196,9 +1251,9 @@ var require_tags = __commonJS({
1196
1251
  }
1197
1252
  });
1198
1253
 
1199
- // ../../node_modules/@domql/utils/dist/cjs/index.js
1254
+ // ../../../domql/packages/utils/dist/cjs/index.js
1200
1255
  var require_cjs2 = __commonJS({
1201
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
1256
+ "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
1202
1257
  "use strict";
1203
1258
  var __defProp2 = Object.defineProperty;
1204
1259
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;