@symbo.ls/scratch 2.11.360 → 2.11.373

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.
@@ -333,6 +333,7 @@ var require_array = __commonJS({
333
333
  createNestedObject: () => createNestedObject,
334
334
  cutArrayAfterValue: () => cutArrayAfterValue,
335
335
  cutArrayBeforeValue: () => cutArrayBeforeValue,
336
+ getFrequencyInArray: () => getFrequencyInArray,
336
337
  joinArrays: () => joinArrays,
337
338
  mergeAndCloneIfArray: () => mergeAndCloneIfArray,
338
339
  mergeArray: () => mergeArray,
@@ -347,6 +348,11 @@ var require_array = __commonJS({
347
348
  var arrayContainsOtherArray = (arr1, arr2) => {
348
349
  return arr2.every((val) => arr1.includes(val));
349
350
  };
351
+ var getFrequencyInArray = (arr, value) => {
352
+ return arr.reduce((count, currentValue) => {
353
+ return currentValue === value ? count + 1 : count;
354
+ }, 0);
355
+ };
350
356
  var removeFromArray = (arr, index) => {
351
357
  if ((0, import_types.isString)(index))
352
358
  index = parseInt(index);
@@ -413,7 +419,7 @@ var require_array = __commonJS({
413
419
  newArray.splice(index, 1);
414
420
  return newArray;
415
421
  }
416
- return arr.slice();
422
+ return arr;
417
423
  };
418
424
  var removeValueFromArrayAll = (arr, value) => {
419
425
  return arr.filter((item) => item !== value);
@@ -761,7 +767,7 @@ var require_object = __commonJS({
761
767
  continue;
762
768
  const objProp = obj[prop];
763
769
  if ((0, import_types.isString)(objProp)) {
764
- if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
770
+ if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
765
771
  try {
766
772
  const evalProp = import_globals2.window.eval(`(${objProp})`);
767
773
  destringified[prop] = evalProp;
@@ -801,11 +807,11 @@ var require_object = __commonJS({
801
807
  }
802
808
  return destringified;
803
809
  };
804
- var stringToObject = (str, verbose) => {
810
+ var stringToObject = (str, opts = { verbose: true }) => {
805
811
  try {
806
812
  return import_globals2.window.eval("(" + str + ")");
807
813
  } catch (e) {
808
- if (verbose)
814
+ if (opts.verbose)
809
815
  console.warn(e);
810
816
  }
811
817
  };