@salespark/toolkit 2.1.4 → 2.1.5

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
@@ -391,12 +391,11 @@ var hasNilOrEmpty = (array) => {
391
391
  };
392
392
  var isNilEmptyOrZeroLength = (value) => {
393
393
  try {
394
- if (isNil(value) || value === "") return true;
395
- if (typeof value === "object" && value !== null && "length" in value) {
396
- const length = value.length;
397
- return typeof length === "number" && length === 0;
398
- }
399
- return false;
394
+ if (isNil(value)) return true;
395
+ if (value === "") return true;
396
+ if (typeof value === "string" && value.length > 0) return false;
397
+ if (Array.isArray(value) && value.length > 0) return false;
398
+ return true;
400
399
  } catch {
401
400
  return true;
402
401
  }
@@ -405,11 +404,8 @@ var isNilEmptyOrZeroLen = isNilEmptyOrZeroLength;
405
404
  var isNilOrZeroLength = (value) => {
406
405
  try {
407
406
  if (isNil(value)) return true;
408
- if (typeof value === "object" && value !== null && "length" in value) {
409
- const length = value.length;
410
- return typeof length === "number" && length === 0;
411
- }
412
- return false;
407
+ if (Array.isArray(value) && value.length > 0) return false;
408
+ return true;
413
409
  } catch {
414
410
  return true;
415
411
  }