util-helpers 4.23.5 → 4.23.7
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 +7 -8
- 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/esm/index.js +1 -1
- package/esm/parseIdCard.js +2 -2
- package/lib/VERSION.js +1 -1
- package/lib/formatMoney.js +3 -4
- package/lib/index.js +1 -1
- package/lib/parseIdCard.js +2 -2
- package/package.json +1 -1
- package/types/formatMoney.d.ts +2 -0
package/dist/util-helpers.js
CHANGED
|
@@ -909,10 +909,9 @@
|
|
|
909
909
|
return decimal + ret;
|
|
910
910
|
}
|
|
911
911
|
var formatMoney = function (num, options) {
|
|
912
|
-
if (num === void 0) { num = ''; }
|
|
913
912
|
if (options === void 0) { options = {}; }
|
|
914
|
-
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;
|
|
915
|
-
if (!checkNumber(num)) {
|
|
913
|
+
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;
|
|
914
|
+
if (!checkNumber(num) || (strict && (!isString(num) || num === '') && !isNumber(num))) {
|
|
916
915
|
return '';
|
|
917
916
|
}
|
|
918
917
|
if (typeof num === 'number' && !isFinite(num)) {
|
|
@@ -928,7 +927,7 @@
|
|
|
928
927
|
thousand = typeof thousand === 'string' ? thousand : ',';
|
|
929
928
|
decimal = typeof decimal === 'string' ? decimal : '.';
|
|
930
929
|
var strNum = transformEffectiveNumber(num) + '';
|
|
931
|
-
var
|
|
930
|
+
var _e = __read(strNum.split('.'), 2), intStr = _e[0], decStr = _e[1];
|
|
932
931
|
return symbol + formatInt(intStr, thousand) + formatDec(decStr, precision, decimal);
|
|
933
932
|
};
|
|
934
933
|
|
|
@@ -1094,7 +1093,7 @@
|
|
|
1094
1093
|
return sizes[i] ? "".concat(Number((numBytes / Math.pow(k, i)).toFixed(precision))).concat(spaceMark).concat(sizes[i]) : numBytes + '';
|
|
1095
1094
|
}
|
|
1096
1095
|
|
|
1097
|
-
var regIdCard = /^(
|
|
1096
|
+
var regIdCard = /^(\d{2})(\d{2})(\d{2})((?:\d{2})?\d{2})(\d{2})(\d{2})\d{2}(\d)(?:\d|X)?$/i;
|
|
1098
1097
|
var Provinces = [
|
|
1099
1098
|
['11', '北京市'],
|
|
1100
1099
|
['12', '天津市'],
|
|
@@ -1137,7 +1136,7 @@
|
|
|
1137
1136
|
if (!match) {
|
|
1138
1137
|
return null;
|
|
1139
1138
|
}
|
|
1140
|
-
var origin =
|
|
1139
|
+
var origin = {
|
|
1141
1140
|
province: match[1],
|
|
1142
1141
|
city: match[2],
|
|
1143
1142
|
area: match[3],
|
|
@@ -2599,9 +2598,9 @@
|
|
|
2599
2598
|
return internalFindTreeSelect(tree, predicate, childrenField);
|
|
2600
2599
|
}
|
|
2601
2600
|
|
|
2602
|
-
var VERSION = "4.23.
|
|
2601
|
+
var VERSION = "4.23.7";
|
|
2603
2602
|
|
|
2604
|
-
var version = "4.23.
|
|
2603
|
+
var version = "4.23.7";
|
|
2605
2604
|
|
|
2606
2605
|
exports.AsyncMemo = AsyncMemo;
|
|
2607
2606
|
exports.VERSION = VERSION;
|