util-helpers 5.1.1 → 5.1.3

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.
Files changed (42) hide show
  1. package/dist/util-helpers.js +4 -5
  2. package/dist/util-helpers.js.map +1 -1
  3. package/dist/util-helpers.min.js +1 -1
  4. package/dist/util-helpers.min.js.map +1 -1
  5. package/esm/VERSION.js +1 -1
  6. package/esm/formatMoney.js +4 -5
  7. package/lib/VERSION.js +1 -1
  8. package/lib/formatMoney.js +3 -4
  9. package/package.json +1 -1
  10. package/types/AsyncMemo.d.ts +1 -1
  11. package/types/bytesToSize.d.ts +2 -2
  12. package/types/calculateCursorPosition.d.ts +2 -2
  13. package/types/checkFileType.d.ts +20 -0
  14. package/types/compressImage.d.ts +6 -5
  15. package/types/download.d.ts +2 -0
  16. package/types/fileReader.d.ts +1 -1
  17. package/types/filterTree.d.ts +2 -2
  18. package/types/findTreeNode.d.ts +1 -1
  19. package/types/findTreeNodes.d.ts +1 -1
  20. package/types/findTreeSelect.d.ts +1 -1
  21. package/types/formatBankCard.d.ts +2 -2
  22. package/types/formatMobile.d.ts +1 -1
  23. package/types/formatMoney.d.ts +5 -3
  24. package/types/getFileType.d.ts +9 -0
  25. package/types/isBankCard.d.ts +2 -2
  26. package/types/isBusinessLicense.d.ts +1 -1
  27. package/types/isChinese.d.ts +2 -2
  28. package/types/isIdCard.d.ts +2 -2
  29. package/types/isPassword.d.ts +3 -3
  30. package/types/isTWCard.d.ts +1 -1
  31. package/types/isValidNumber.d.ts +1 -1
  32. package/types/listToTree.d.ts +5 -5
  33. package/types/loadScript.d.ts +3 -3
  34. package/types/numberToChinese.d.ts +7 -7
  35. package/types/padZero.d.ts +1 -1
  36. package/types/randomString.d.ts +2 -2
  37. package/types/replaceChar.d.ts +3 -3
  38. package/types/round.d.ts +1 -1
  39. package/types/setDataURLPrefix.d.ts +2 -2
  40. package/types/transformFieldNames.d.ts +1 -1
  41. package/types/transformObjectValue.d.ts +1 -1
  42. package/types/validatePassword.d.ts +3 -3
@@ -902,10 +902,9 @@
902
902
  return decimal + ret;
903
903
  }
904
904
  var formatMoney = function (num, options) {
905
- if (num === void 0) { num = ''; }
906
905
  if (options === void 0) { options = {}; }
907
- var _a = options.precision, precision = _a === void 0 ? 2 : _a, symbol = options.symbol, _b = options.thousand, thousand = _b === void 0 ? ',' : _b, _c = options.decimal, decimal = _c === void 0 ? '.' : _c;
908
- if (!checkNumber(num)) {
906
+ var _a = options.precision, precision = _a === void 0 ? 2 : _a, symbol = options.symbol, _b = options.thousand, thousand = _b === void 0 ? ',' : _b, _c = options.decimal, decimal = _c === void 0 ? '.' : _c, _d = options.strict, strict = _d === void 0 ? true : _d;
907
+ if (!checkNumber(num) || (strict && (!isString(num) || num === '') && !isNumber(num))) {
909
908
  return '';
910
909
  }
911
910
  if (typeof num === 'number' && !isFinite(num)) {
@@ -921,7 +920,7 @@
921
920
  thousand = typeof thousand === 'string' ? thousand : ',';
922
921
  decimal = typeof decimal === 'string' ? decimal : '.';
923
922
  var strNum = transformEffectiveNumber(num) + '';
924
- var _d = __read(strNum.split('.'), 2), intStr = _d[0], decStr = _d[1];
923
+ var _e = __read(strNum.split('.'), 2), intStr = _e[0], decStr = _e[1];
925
924
  return symbol + formatInt(intStr, thousand) + formatDec(decStr, precision, decimal);
926
925
  };
927
926
 
@@ -2077,7 +2076,7 @@
2077
2076
  return internalFindTreeSelect(tree, predicate, childrenField);
2078
2077
  }
2079
2078
 
2080
- var VERSION = "5.1.1";
2079
+ var VERSION = "5.1.3";
2081
2080
 
2082
2081
  var EmitterPro = /** @class */ (function () {
2083
2082
  function EmitterPro() {