@salespark/toolkit 2.1.10 → 2.1.11

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/index.cjs CHANGED
@@ -451,6 +451,7 @@ var formatDecimalNumber = (value, decimals = 2) => {
451
451
 
452
452
  // src/utils/func.ts
453
453
  function safeJSONParse(input, defaultValue) {
454
+ const def = isNilOrEmpty(defaultValue) === false ? defaultValue : {};
454
455
  if (typeof input === "object" && input !== null) {
455
456
  return input;
456
457
  }
@@ -459,10 +460,10 @@ function safeJSONParse(input, defaultValue) {
459
460
  const parsed = JSON.parse(input);
460
461
  return parsed;
461
462
  } catch {
462
- return defaultValue;
463
+ return def;
463
464
  }
464
465
  }
465
- return defaultValue;
466
+ return def;
466
467
  }
467
468
  function debounce(fn, wait = 250) {
468
469
  let t;