@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 +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
|
463
|
+
return def;
|
|
463
464
|
}
|
|
464
465
|
}
|
|
465
|
-
return
|
|
466
|
+
return def;
|
|
466
467
|
}
|
|
467
468
|
function debounce(fn, wait = 250) {
|
|
468
469
|
let t;
|