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.
- package/dist/util-helpers.js +4 -5
- package/dist/util-helpers.js.map +1 -1
- package/dist/util-helpers.min.js +1 -1
- package/dist/util-helpers.min.js.map +1 -1
- package/esm/VERSION.js +1 -1
- package/esm/formatMoney.js +4 -5
- package/lib/VERSION.js +1 -1
- package/lib/formatMoney.js +3 -4
- package/package.json +1 -1
- package/types/AsyncMemo.d.ts +1 -1
- package/types/bytesToSize.d.ts +2 -2
- package/types/calculateCursorPosition.d.ts +2 -2
- package/types/checkFileType.d.ts +20 -0
- package/types/compressImage.d.ts +6 -5
- package/types/download.d.ts +2 -0
- package/types/fileReader.d.ts +1 -1
- package/types/filterTree.d.ts +2 -2
- package/types/findTreeNode.d.ts +1 -1
- package/types/findTreeNodes.d.ts +1 -1
- package/types/findTreeSelect.d.ts +1 -1
- package/types/formatBankCard.d.ts +2 -2
- package/types/formatMobile.d.ts +1 -1
- package/types/formatMoney.d.ts +5 -3
- package/types/getFileType.d.ts +9 -0
- package/types/isBankCard.d.ts +2 -2
- package/types/isBusinessLicense.d.ts +1 -1
- package/types/isChinese.d.ts +2 -2
- package/types/isIdCard.d.ts +2 -2
- package/types/isPassword.d.ts +3 -3
- package/types/isTWCard.d.ts +1 -1
- package/types/isValidNumber.d.ts +1 -1
- package/types/listToTree.d.ts +5 -5
- package/types/loadScript.d.ts +3 -3
- package/types/numberToChinese.d.ts +7 -7
- package/types/padZero.d.ts +1 -1
- package/types/randomString.d.ts +2 -2
- package/types/replaceChar.d.ts +3 -3
- package/types/round.d.ts +1 -1
- package/types/setDataURLPrefix.d.ts +2 -2
- package/types/transformFieldNames.d.ts +1 -1
- package/types/transformObjectValue.d.ts +1 -1
- package/types/validatePassword.d.ts +3 -3
package/dist/util-helpers.js
CHANGED
|
@@ -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
|
|
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.
|
|
2079
|
+
var VERSION = "5.1.3";
|
|
2081
2080
|
|
|
2082
2081
|
var EmitterPro = /** @class */ (function () {
|
|
2083
2082
|
function EmitterPro() {
|