util-helpers 4.16.2 → 4.17.1
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 +1600 -4039
- 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/ajax.js +50 -146
- package/esm/blobToDataURL.js +4 -34
- package/esm/bytesToSize.js +12 -37
- package/esm/calculateCursorPosition.js +30 -52
- package/esm/dataURLToBlob.js +14 -28
- package/esm/divide.js +24 -48
- package/esm/download.js +83 -164
- package/esm/fileReader.js +18 -64
- package/esm/filterTree.js +25 -55
- package/esm/findTreeNode.js +39 -67
- package/esm/findTreeNodes.js +35 -66
- package/esm/findTreeSelect.js +38 -74
- package/esm/formatBankCard.js +13 -43
- package/esm/formatMobile.js +17 -43
- package/esm/formatMoney.js +59 -139
- package/esm/index.js +55 -130
- package/esm/isBankCard.js +22 -57
- package/esm/isBusinessLicense.js +32 -78
- package/esm/isChinese.js +23 -66
- package/esm/isEmail.js +6 -21
- package/esm/isHMCard.js +5 -28
- package/esm/isIPv4.js +5 -22
- package/esm/isIPv6.js +5 -36
- package/esm/isIdCard.js +27 -66
- package/esm/isMobile.js +5 -20
- package/esm/isPassport.js +5 -22
- package/esm/isPassword.js +7 -48
- package/esm/isPostcode.js +5 -20
- package/esm/isPromiseLike.js +3 -18
- package/esm/isQQ.js +5 -20
- package/esm/isSocialCreditCode.js +28 -83
- package/esm/isSwiftCode.js +6 -25
- package/esm/isTWCard.js +11 -37
- package/esm/isTelephone.js +6 -27
- package/esm/isUrl.js +5 -44
- package/esm/isVehicle.js +5 -28
- package/esm/isWX.js +5 -20
- package/esm/listToTree.js +51 -120
- package/esm/minus.js +21 -39
- package/esm/normalizeString.js +8 -29
- package/esm/numberToChinese.js +96 -215
- package/esm/padZero.js +14 -36
- package/esm/parseIdCard.js +64 -129
- package/esm/plus.js +21 -39
- package/esm/randomString.js +13 -45
- package/esm/replaceChar.js +27 -77
- package/esm/round.js +14 -31
- package/esm/safeDate.js +12 -55
- package/esm/setDataURLPrefix.js +6 -29
- package/esm/strlen.js +14 -30
- package/esm/times.js +24 -42
- package/esm/transformFieldNames.js +37 -93
- package/esm/treeToList.js +25 -84
- package/esm/utils/config.js +4 -14
- package/esm/utils/constants.js +4 -4
- package/esm/utils/convertToString.js +4 -9
- package/esm/utils/devWarn.js +11 -11
- package/esm/utils/math.util.js +95 -181
- package/esm/utils/type/isBlob.js +4 -24
- package/esm/utils/type/isNaN.js +4 -19
- package/esm/utils/type/isNil.js +5 -13
- package/esm/utils/type/isNull.js +3 -18
- package/esm/utils/type/isNumber.js +4 -28
- package/esm/utils/type/isObject.js +4 -23
- package/esm/utils/type/isString.js +4 -19
- package/esm/utils/type/isSymbol.js +4 -19
- package/esm/utils/type/isType.js +3 -12
- package/esm/utils/type/isUndefined.js +3 -21
- package/esm/validatePassword.js +86 -237
- package/esm/waitTime.js +7 -26
- package/lib/ajax.js +51 -152
- package/lib/blobToDataURL.js +5 -40
- package/lib/bytesToSize.js +13 -43
- package/lib/calculateCursorPosition.js +32 -58
- package/lib/dataURLToBlob.js +15 -34
- package/lib/divide.js +26 -60
- package/lib/download.js +85 -169
- package/lib/fileReader.js +19 -70
- package/lib/filterTree.js +27 -66
- package/lib/findTreeNode.js +40 -77
- package/lib/findTreeNodes.js +36 -76
- package/lib/findTreeSelect.js +40 -82
- package/lib/formatBankCard.js +15 -50
- package/lib/formatMobile.js +19 -50
- package/lib/formatMoney.js +60 -150
- package/lib/index.js +117 -395
- package/lib/isBankCard.js +24 -64
- package/lib/isBusinessLicense.js +34 -85
- package/lib/isChinese.js +24 -73
- package/lib/isEmail.js +7 -27
- package/lib/isHMCard.js +7 -35
- package/lib/isIPv4.js +7 -29
- package/lib/isIPv6.js +7 -43
- package/lib/isIdCard.js +29 -73
- package/lib/isMobile.js +7 -27
- package/lib/isPassport.js +7 -29
- package/lib/isPassword.js +9 -55
- package/lib/isPostcode.js +7 -27
- package/lib/isPromiseLike.js +4 -24
- package/lib/isQQ.js +7 -27
- package/lib/isSocialCreditCode.js +30 -90
- package/lib/isSwiftCode.js +7 -32
- package/lib/isTWCard.js +13 -44
- package/lib/isTelephone.js +7 -33
- package/lib/isUrl.js +6 -49
- package/lib/isVehicle.js +7 -35
- package/lib/isWX.js +7 -27
- package/lib/listToTree.js +53 -131
- package/lib/minus.js +23 -51
- package/lib/normalizeString.js +10 -36
- package/lib/numberToChinese.js +98 -222
- package/lib/padZero.js +16 -43
- package/lib/parseIdCard.js +65 -138
- package/lib/plus.js +23 -51
- package/lib/randomString.js +14 -51
- package/lib/replaceChar.js +28 -83
- package/lib/round.js +15 -37
- package/lib/safeDate.js +13 -63
- package/lib/setDataURLPrefix.js +7 -35
- package/lib/strlen.js +16 -37
- package/lib/times.js +26 -53
- package/lib/transformFieldNames.js +38 -101
- package/lib/treeToList.js +27 -94
- package/lib/utils/config.js +6 -23
- package/lib/utils/constants.js +3 -11
- package/lib/utils/convertToString.js +6 -16
- package/lib/utils/devWarn.js +13 -17
- package/lib/utils/math.util.js +95 -185
- package/lib/utils/type/isBlob.js +6 -31
- package/lib/utils/type/isNaN.js +6 -26
- package/lib/utils/type/isNil.js +7 -20
- package/lib/utils/type/isNull.js +4 -24
- package/lib/utils/type/isNumber.js +6 -35
- package/lib/utils/type/isObject.js +5 -29
- package/lib/utils/type/isString.js +6 -26
- package/lib/utils/type/isSymbol.js +6 -26
- package/lib/utils/type/isType.js +4 -18
- package/lib/utils/type/isUndefined.js +4 -27
- package/lib/validatePassword.js +87 -244
- package/lib/waitTime.js +8 -32
- package/package.json +21 -25
- package/types/ajax.d.ts +38 -95
- package/types/blobToDataURL.d.ts +2 -2
- package/types/bytesToSize.d.ts +7 -6
- package/types/calculateCursorPosition.d.ts +10 -9
- package/types/dataURLToBlob.d.ts +5 -5
- package/types/divide.d.ts +2 -2
- package/types/download.d.ts +22 -38
- package/types/fileReader.d.ts +35 -2
- package/types/filterTree.d.ts +6 -7
- package/types/findTreeNode.d.ts +5 -7
- package/types/findTreeNodes.d.ts +5 -7
- package/types/findTreeSelect.d.ts +5 -7
- package/types/formatBankCard.d.ts +8 -5
- package/types/formatMobile.d.ts +7 -4
- package/types/formatMoney.d.ts +8 -7
- package/types/index.d.ts +125 -55
- package/types/isBankCard.d.ts +9 -8
- package/types/isBusinessLicense.d.ts +8 -5
- package/types/isChinese.d.ts +9 -8
- package/types/isEmail.d.ts +1 -1
- package/types/isHMCard.d.ts +2 -2
- package/types/isIPv4.d.ts +1 -1
- package/types/isIPv6.d.ts +1 -1
- package/types/isIdCard.d.ts +8 -7
- package/types/isMobile.d.ts +1 -1
- package/types/isPassport.d.ts +2 -2
- package/types/isPassword.d.ts +4 -7
- package/types/isPostcode.d.ts +1 -1
- package/types/isPromiseLike.d.ts +1 -1
- package/types/isQQ.d.ts +1 -1
- package/types/isSocialCreditCode.d.ts +8 -5
- package/types/isSwiftCode.d.ts +2 -2
- package/types/isTWCard.d.ts +6 -5
- package/types/isTelephone.d.ts +1 -1
- package/types/isUrl.d.ts +2 -2
- package/types/isVehicle.d.ts +2 -2
- package/types/isWX.d.ts +1 -1
- package/types/listToTree.d.ts +12 -12
- package/types/minus.d.ts +3 -2
- package/types/normalizeString.d.ts +2 -2
- package/types/numberToChinese.d.ts +13 -12
- package/types/padZero.d.ts +2 -2
- package/types/parseIdCard.d.ts +17 -56
- package/types/plus.d.ts +3 -2
- package/types/randomString.d.ts +2 -2
- package/types/replaceChar.d.ts +15 -11
- package/types/round.d.ts +2 -2
- package/types/safeDate.d.ts +24 -2
- package/types/setDataURLPrefix.d.ts +5 -5
- package/types/strlen.d.ts +1 -1
- package/types/times.d.ts +3 -2
- package/types/transformFieldNames.d.ts +12 -10
- package/types/treeToList.d.ts +1 -1
- package/types/utils/config.d.ts +6 -5
- package/types/utils/constants.d.ts +2 -2
- package/types/utils/convertToString.d.ts +1 -1
- package/types/utils/devWarn.d.ts +1 -1
- package/types/utils/math.util.d.ts +15 -9
- package/types/utils/type/index.d.ts +7 -0
- package/types/utils/type/isArguments.d.ts +1 -1
- package/types/utils/type/isArray.d.ts +1 -1
- package/types/utils/type/isArrayBuffer.d.ts +1 -1
- package/types/utils/type/isBlob.d.ts +1 -1
- package/types/utils/type/isBoolean.d.ts +1 -1
- package/types/utils/type/isDate.d.ts +1 -1
- package/types/utils/type/isError.d.ts +1 -1
- package/types/utils/type/isFunction.d.ts +1 -1
- package/types/utils/type/isMap.d.ts +1 -1
- package/types/utils/type/isNaN.d.ts +1 -1
- package/types/utils/type/isNil.d.ts +1 -1
- package/types/utils/type/isNull.d.ts +1 -1
- package/types/utils/type/isNumber.d.ts +1 -1
- package/types/utils/type/isObject.d.ts +1 -1
- package/types/utils/type/isRegExp.d.ts +1 -1
- package/types/utils/type/isSet.d.ts +1 -1
- package/types/utils/type/isString.d.ts +1 -1
- package/types/utils/type/isSymbol.d.ts +1 -1
- package/types/utils/type/isType.d.ts +1 -1
- package/types/utils/type/isUndefined.d.ts +1 -1
- package/types/utils/type/isWeakMap.d.ts +1 -1
- package/types/utils/type/isWeakSet.d.ts +1 -1
- package/types/validatePassword.d.ts +17 -48
- package/types/waitTime.d.ts +2 -2
- package/esm/interface.doc.js +0 -125
- package/esm/interface.type.js +0 -17
- package/esm/utils/type/index.js +0 -29
- package/esm/utils/type/isArguments.js +0 -22
- package/esm/utils/type/isArray.js +0 -22
- package/esm/utils/type/isArrayBuffer.js +0 -25
- package/esm/utils/type/isBoolean.js +0 -22
- package/esm/utils/type/isDate.js +0 -22
- package/esm/utils/type/isError.js +0 -22
- package/esm/utils/type/isFunction.js +0 -22
- package/esm/utils/type/isMap.js +0 -22
- package/esm/utils/type/isRegExp.js +0 -22
- package/esm/utils/type/isSet.js +0 -22
- package/esm/utils/type/isWeakMap.js +0 -22
- package/esm/utils/type/isWeakSet.js +0 -22
- package/lib/interface.doc.js +0 -127
- package/lib/interface.type.js +0 -5
- package/lib/utils/type/index.js +0 -146
- package/lib/utils/type/isArguments.js +0 -29
- package/lib/utils/type/isArray.js +0 -29
- package/lib/utils/type/isArrayBuffer.js +0 -32
- package/lib/utils/type/isBoolean.js +0 -29
- package/lib/utils/type/isDate.js +0 -29
- package/lib/utils/type/isError.js +0 -29
- package/lib/utils/type/isFunction.js +0 -29
- package/lib/utils/type/isMap.js +0 -29
- package/lib/utils/type/isRegExp.js +0 -29
- package/lib/utils/type/isSet.js +0 -29
- package/lib/utils/type/isWeakMap.js +0 -29
- package/lib/utils/type/isWeakSet.js +0 -29
- package/types/interface.type.d.ts +0 -2
package/lib/plus.js
CHANGED
|
@@ -1,54 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _math = require("./utils/math.util");
|
|
8
|
-
var _times = _interopRequireDefault(require("./times"));
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
11
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
14
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
15
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
16
|
-
/**
|
|
17
|
-
* 精确加法,支持多个数相加,加数默认为 0 。
|
|
18
|
-
*
|
|
19
|
-
* @static
|
|
20
|
-
* @alias module:Math.plus
|
|
21
|
-
* @since 3.1.0
|
|
22
|
-
* @param {...number|string} nums 相加的数
|
|
23
|
-
* @returns {number} 总和
|
|
24
|
-
* @example
|
|
25
|
-
*
|
|
26
|
-
* plus(0.1, 0.2); // 0.3
|
|
27
|
-
* plus(0.1, 0.2, 0.3); // 0.6
|
|
28
|
-
* plus(0.1, 0.2, 0.3, 0.4); // 1
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
function plus() {
|
|
32
|
-
for (var _len = arguments.length, nums = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
33
|
-
nums[_key] = arguments[_key];
|
|
34
|
-
}
|
|
35
|
-
var num1 = nums[0],
|
|
36
|
-
_nums$ = nums[1],
|
|
37
|
-
num2 = _nums$ === void 0 ? 0 : _nums$,
|
|
38
|
-
rest = nums.slice(2);
|
|
39
|
-
if (rest.length > 0) {
|
|
40
|
-
return plus.apply(void 0, [plus(num1, num2)].concat(_toConsumableArray(rest)));
|
|
41
|
-
}
|
|
42
|
-
num1 = (0, _math.transformEffectiveNumber)(num1);
|
|
43
|
-
num2 = (0, _math.transformEffectiveNumber)(num2);
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var math_util = require('./utils/math.util.js');
|
|
5
|
+
var times = require('./times.js');
|
|
6
|
+
var isNaN = require('./utils/type/isNaN.js');
|
|
44
7
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
8
|
+
function plus() {
|
|
9
|
+
var nums = [];
|
|
10
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
11
|
+
nums[_i] = arguments[_i];
|
|
12
|
+
}
|
|
13
|
+
var _a = tslib.__read(nums), num1 = _a[0], _b = _a[1], num2 = _b === void 0 ? 0 : _b, rest = _a.slice(2);
|
|
14
|
+
if (rest.length > 0) {
|
|
15
|
+
return plus.apply(void 0, tslib.__spreadArray([plus(num1, num2)], tslib.__read(rest), false));
|
|
16
|
+
}
|
|
17
|
+
num1 = math_util.transformEffectiveNumber(num1);
|
|
18
|
+
num2 = math_util.transformEffectiveNumber(num2);
|
|
19
|
+
if (isNaN(num1) || isNaN(num2)) {
|
|
20
|
+
return Number.NaN;
|
|
21
|
+
}
|
|
22
|
+
var baseNum = Math.pow(10, Math.max(math_util.digitLength(num1), math_util.digitLength(num2)));
|
|
23
|
+
return (times(num1, baseNum) + times(num2, baseNum)) / baseNum;
|
|
52
24
|
}
|
|
53
|
-
|
|
54
|
-
exports
|
|
25
|
+
|
|
26
|
+
module.exports = plus;
|
package/lib/randomString.js
CHANGED
|
@@ -1,57 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
3
|
var numberChars = '0123456789';
|
|
8
4
|
var letterChars = 'abcdefghijklmnopqrstuvwxyz';
|
|
9
5
|
var defaultChars = numberChars + letterChars + letterChars.toUpperCase();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
function internalRandomString(len, optionalChars) {
|
|
19
|
-
var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
20
|
-
while (len-- > 0) {
|
|
21
|
-
var r = optionalChars[Math.floor(Math.random() * optionalChars.length)];
|
|
22
|
-
return internalRandomString(len, optionalChars, prefix + r);
|
|
23
|
-
}
|
|
24
|
-
return prefix;
|
|
6
|
+
function internalRandomString(len, optionalChars, prefix) {
|
|
7
|
+
if (prefix === void 0) { prefix = ''; }
|
|
8
|
+
while (len-- > 0) {
|
|
9
|
+
var r = optionalChars[Math.floor(Math.random() * optionalChars.length)];
|
|
10
|
+
return internalRandomString(len, optionalChars, prefix + r);
|
|
11
|
+
}
|
|
12
|
+
return prefix;
|
|
25
13
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* @static
|
|
31
|
-
* @alias module:Other.randomString
|
|
32
|
-
* @since 4.8.0
|
|
33
|
-
* @param {number} [len=0] 长度
|
|
34
|
-
* @param {string} [optionalChars='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'] 允许的字符,默认为数字和大小写字母
|
|
35
|
-
* @returns {string} 随机字符串
|
|
36
|
-
* @example
|
|
37
|
-
*
|
|
38
|
-
* randomString(5); // slk23
|
|
39
|
-
* randomString(8); // 71mHqo2A
|
|
40
|
-
*
|
|
41
|
-
* // 自定义允许的字符
|
|
42
|
-
* randomString(5, 'abc'); // ccbcb
|
|
43
|
-
* randomString(8, 'abcefg'); // bcgcfabg
|
|
44
|
-
*
|
|
45
|
-
*/
|
|
46
|
-
function randomString() {
|
|
47
|
-
var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
48
|
-
var optionalChars = arguments.length > 1 ? arguments[1] : undefined;
|
|
49
|
-
var realLen = typeof len === 'number' ? len : Number(len);
|
|
50
|
-
if (isNaN(realLen)) {
|
|
51
|
-
realLen = 0;
|
|
52
|
-
}
|
|
53
|
-
var realChars = typeof optionalChars === 'string' && optionalChars ? optionalChars : defaultChars;
|
|
54
|
-
return internalRandomString(len, realChars);
|
|
14
|
+
function randomString(len, optionalChars) {
|
|
15
|
+
if (len === void 0) { len = 0; }
|
|
16
|
+
var realChars = typeof optionalChars === 'string' && optionalChars ? optionalChars : defaultChars;
|
|
17
|
+
return internalRandomString(len, realChars);
|
|
55
18
|
}
|
|
56
|
-
|
|
57
|
-
exports
|
|
19
|
+
|
|
20
|
+
module.exports = randomString;
|
package/lib/replaceChar.js
CHANGED
|
@@ -1,86 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _normalizeString = _interopRequireDefault(require("./normalizeString"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
|
-
/**
|
|
10
|
-
* 替换字符,应用场景如:脱敏
|
|
11
|
-
*
|
|
12
|
-
* @static
|
|
13
|
-
* @alias module:Processor.replaceChar
|
|
14
|
-
* @since 1.1.0
|
|
15
|
-
* @param {string} str 要处理的字符串
|
|
16
|
-
* @param {Object} [options] 配置项
|
|
17
|
-
* @param {number} [options.start=3] 开始位置
|
|
18
|
-
* @param {number} [options.end=-4] 结束位置
|
|
19
|
-
* @param {string} [options.char="*"] 替换字符
|
|
20
|
-
* @param {number} [options.repeat] 替换字符的重复次数,默认为替换内容长度,可设置为固定值
|
|
21
|
-
* @param {string} [options.exclude] 排除字符,如果指定排除项,repeat设置无效
|
|
22
|
-
* @returns {string} 处理后的字符
|
|
23
|
-
* @example
|
|
24
|
-
*
|
|
25
|
-
* // 手机号 前3后4
|
|
26
|
-
* replaceChar('13000000000'); // 130****0000
|
|
27
|
-
*
|
|
28
|
-
* // 身份证 前6后4
|
|
29
|
-
* replaceChar('130701199310302288', { start: 6, end: -4 }); // 130701********2288
|
|
30
|
-
*
|
|
31
|
-
* // 邮箱 @前两位
|
|
32
|
-
* const email = '12345@qq.com'
|
|
33
|
-
* const emailAtIndex = email.indexOf('@');
|
|
34
|
-
* replaceChar(email, { start: emailAtIndex - 2, end: emailAtIndex }); // 123**@qq.com
|
|
35
|
-
* // 邮箱 前2和@后面内容,固定替换字符4位
|
|
36
|
-
* replaceChar(email, {start: 2, end: email.indexOf('@'), repeat: 4}); // 12****@qq.com
|
|
37
|
-
*
|
|
38
|
-
* // 银行卡号 只展示后4位,固定替换字符4位
|
|
39
|
-
* replaceChar('6228480402564890018', {start: 0, end: -4, repeat: 4}); // ****0018
|
|
40
|
-
* // 银行卡号 前6后4
|
|
41
|
-
* replaceChar('6228480402564890018', { start: 6, end: -4 }); // 622848*********0018
|
|
42
|
-
* // 银行卡号 前4后3 忽略格式的空格
|
|
43
|
-
* replaceChar('6228 4804 0256 4890 018', {start: 4, end: -4, exclude: ' '}); // 6228 **** **** **** 018
|
|
44
|
-
*
|
|
45
|
-
* // 用户名
|
|
46
|
-
* replaceChar('林某某', {start: 1, end: Infinity, repeat: 2}); // 林**
|
|
47
|
-
* replaceChar('林某', {start: 1, end: Infinity, repeat: 2}); // 林**
|
|
48
|
-
* replaceChar('林某某某', {start: 1, end: Infinity, repeat: 2}); // 林**
|
|
49
|
-
*
|
|
50
|
-
*/
|
|
51
|
-
function replaceChar(str) {
|
|
52
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
53
|
-
var _options$char = options["char"],
|
|
54
|
-
_char = _options$char === void 0 ? '*' : _options$char,
|
|
55
|
-
exclude = options.exclude;
|
|
56
|
-
var _options$start = options.start,
|
|
57
|
-
start = _options$start === void 0 ? 3 : _options$start,
|
|
58
|
-
_options$end = options.end,
|
|
59
|
-
end = _options$end === void 0 ? -4 : _options$end,
|
|
60
|
-
repeat = options.repeat;
|
|
61
|
-
var realStr = (0, _normalizeString["default"])(str);
|
|
62
|
-
var strLen = realStr.length;
|
|
3
|
+
var normalizeString = require('./normalizeString.js');
|
|
63
4
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
middleStr =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
5
|
+
function replaceChar(str, options) {
|
|
6
|
+
if (options === void 0) { options = {}; }
|
|
7
|
+
var _a = options.char, char = _a === void 0 ? '*' : _a, exclude = options.exclude;
|
|
8
|
+
var _b = options.start, start = _b === void 0 ? 3 : _b, _c = options.end, end = _c === void 0 ? -4 : _c, repeat = options.repeat;
|
|
9
|
+
var realStr = normalizeString(str);
|
|
10
|
+
var strLen = realStr.length;
|
|
11
|
+
if (Math.abs(start) >= strLen) {
|
|
12
|
+
return realStr;
|
|
13
|
+
}
|
|
14
|
+
start = start >= 0 ? start : strLen + start;
|
|
15
|
+
end = end >= 0 ? end : strLen + end;
|
|
16
|
+
if (start >= end) {
|
|
17
|
+
return realStr;
|
|
18
|
+
}
|
|
19
|
+
var middleStr = realStr.substring(start, end);
|
|
20
|
+
if (exclude) {
|
|
21
|
+
var reg = new RegExp("[^".concat(exclude, "]"), 'g');
|
|
22
|
+
middleStr = middleStr.replace(reg, char);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
repeat = typeof repeat === 'number' && repeat >= 0 ? repeat : middleStr.length;
|
|
26
|
+
middleStr = char.repeat(repeat);
|
|
27
|
+
}
|
|
28
|
+
return realStr.substring(0, start) + middleStr + realStr.substring(end);
|
|
84
29
|
}
|
|
85
|
-
|
|
86
|
-
exports
|
|
30
|
+
|
|
31
|
+
module.exports = replaceChar;
|
package/lib/round.js
CHANGED
|
@@ -1,40 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _divide = _interopRequireDefault(require("./divide"));
|
|
8
|
-
var _times = _interopRequireDefault(require("./times"));
|
|
9
|
-
var _math = require("./utils/math.util");
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
/**
|
|
12
|
-
* 四舍五入,支持设置精度
|
|
13
|
-
*
|
|
14
|
-
* @static
|
|
15
|
-
* @alias module:Math.round
|
|
16
|
-
* @since 3.1.0
|
|
17
|
-
* @param {number|string} num 要四舍五入的数字
|
|
18
|
-
* @param {number} [precision=0] 四舍五入的精度
|
|
19
|
-
* @returns {number} 四舍五入的数字
|
|
20
|
-
* @example
|
|
21
|
-
*
|
|
22
|
-
* round(4.006); // 4
|
|
23
|
-
* round(4.006, 2); // 4.01
|
|
24
|
-
* round(4060, -2); // 4100
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
function round(num) {
|
|
28
|
-
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
29
|
-
num = (0, _math.transformEffectiveNumber)(num);
|
|
3
|
+
var divide = require('./divide.js');
|
|
4
|
+
var times = require('./times.js');
|
|
5
|
+
var math_util = require('./utils/math.util.js');
|
|
6
|
+
var isNaN = require('./utils/type/isNaN.js');
|
|
30
7
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
8
|
+
function round(num, precision) {
|
|
9
|
+
if (precision === void 0) { precision = 0; }
|
|
10
|
+
num = math_util.transformEffectiveNumber(num);
|
|
11
|
+
if (isNaN(num)) {
|
|
12
|
+
return Number.NaN;
|
|
13
|
+
}
|
|
14
|
+
var base = Math.pow(10, precision);
|
|
15
|
+
return divide(Math.round(times(num, base)), base);
|
|
38
16
|
}
|
|
39
|
-
|
|
40
|
-
exports
|
|
17
|
+
|
|
18
|
+
module.exports = round;
|
package/lib/safeDate.js
CHANGED
|
@@ -1,67 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
8
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
9
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10
|
-
/**
|
|
11
|
-
* @overload
|
|
12
|
-
* @return {Date}
|
|
13
|
-
*/
|
|
3
|
+
var tslib = require('tslib');
|
|
14
4
|
|
|
15
|
-
/**
|
|
16
|
-
* @overload
|
|
17
|
-
* @param {number | string | Date} value Unix时间戳、时间戳字符串 dateString 、Date 日期对象
|
|
18
|
-
* @return {Date}
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @overload
|
|
23
|
-
* @param {number} year 表示年份的整数值。0 到 99 会被映射至 1900 年至 1999 年,其他值代表实际年份。
|
|
24
|
-
* @param {number} monthIndex 表示月份的整数值,从 0(1 月)到 11(12 月)。
|
|
25
|
-
* @param {number} [date] 表示一个月中的第几天的整数值,从 1 开始。默认值为 1。
|
|
26
|
-
* @param {number} [hours] 表示一天中的小时数的整数值 (24 小时制)。默认值为 0(午夜)。
|
|
27
|
-
* @param {number} [minutes] 表示一个完整时间(如 01:10:00)中的分钟部分的整数值。默认值为 0。
|
|
28
|
-
* @param {number} [seconds] 表示一个完整时间(如 01:10:00)中的秒部分的整数值。默认值为 0。
|
|
29
|
-
* @param {number} [ms] 表示一个完整时间的毫秒部分的整数值。默认值为 0。
|
|
30
|
-
* @return {Date}
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* 创建一个 Date 实例日期对象,同 <a href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date#%E5%8F%82%E6%95%B0">new Date()</a> <br/><br/>
|
|
35
|
-
*
|
|
36
|
-
* 规避了苹果设备浏览器不支持部分格式(例如,YYYY-MM-DD HH-mm 或 YYYY.MM.DD)。<br/>
|
|
37
|
-
* 如果参数为 undefined 正常返回 Date 。
|
|
38
|
-
*
|
|
39
|
-
* @static
|
|
40
|
-
* @alias module:Processor.safeDate
|
|
41
|
-
* @since 4.4.0
|
|
42
|
-
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date|Date}
|
|
43
|
-
* @param {string|number|Date} [value] 日期时间字符串、毫秒数、日期对象
|
|
44
|
-
* @param {...number} args 月/日/时/分/秒/毫秒
|
|
45
|
-
* @returns {Date} Date 实例日期对象
|
|
46
|
-
* @example
|
|
47
|
-
*
|
|
48
|
-
* safeDate('2022-1-1'); // Sat Jan 01 2022 00:00:00 GMT+0800 (中国标准时间)
|
|
49
|
-
* safeDate('2022/1/1'); // Sat Jan 01 2022 00:00:00 GMT+0800 (中国标准时间)
|
|
50
|
-
* safeDate('2022.1.1'); // Sat Jan 01 2022 00:00:00 GMT+0800 (中国标准时间)
|
|
51
|
-
* safeDate('2022.1.1 11:11'); // Sat Jan 01 2022 11:11:00 GMT+0800 (中国标准时间)
|
|
52
|
-
* safeDate(99, 1); // Mon Feb 01 1999 00:00:00 GMT+0800 (中国标准时间)
|
|
53
|
-
* safeDate(1646711233171); // Tue Mar 08 2022 11:47:13 GMT+0800 (中国标准时间)
|
|
54
|
-
*/
|
|
55
5
|
function safeDate(value) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
6
|
+
var args = [];
|
|
7
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
8
|
+
args[_i - 1] = arguments[_i];
|
|
9
|
+
}
|
|
10
|
+
var safeValue = typeof value === 'string' ? value.replace(/[\\.-]/g, '/') : value;
|
|
11
|
+
if (args && args.length > 0) {
|
|
12
|
+
return new (Date.bind.apply(Date, tslib.__spreadArray([void 0, safeValue], tslib.__read(args), false)))();
|
|
13
|
+
}
|
|
14
|
+
return typeof safeValue === 'undefined' ? new Date() : new Date(safeValue);
|
|
65
15
|
}
|
|
66
|
-
|
|
67
|
-
exports
|
|
16
|
+
|
|
17
|
+
module.exports = safeDate;
|
package/lib/setDataURLPrefix.js
CHANGED
|
@@ -1,37 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* 设置 DataURL 前缀、MIME 类型、base64 标识。<br/>
|
|
9
|
-
* 如果你需要获取DataURL 的 MIME 类型和数据本身,推荐使用 <a href="https://www.npmjs.com/package/data-urls">data-urls</a>。
|
|
10
|
-
*
|
|
11
|
-
* @static
|
|
12
|
-
* @alias module:Processor.setDataURLPrefix
|
|
13
|
-
* @since 4.1.0
|
|
14
|
-
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Basics_of_HTTP/Data_URIs|Data URLs}
|
|
15
|
-
* @see {@link https://mimesniff.spec.whatwg.org/#understanding-mime-types|MIME types}
|
|
16
|
-
* @param {string} data 数据本身
|
|
17
|
-
* @param {string} [mimetype="image/png"] MIME 类型
|
|
18
|
-
* @param {boolean} [base64=true] 添加 base64 标识
|
|
19
|
-
* @returns {string} DataURL 格式的字符串
|
|
20
|
-
* @example
|
|
21
|
-
*
|
|
22
|
-
* const data = 'PGEgaWQ9ImEiPjxiIGlkPSJiIj5oZXkhPC9iPjwvYT4=';
|
|
23
|
-
* setDataURLPrefix(data); // data:image/png;base64,PGEgaWQ9ImEiPjxiIGlkPSJiIj5oZXkhPC9iPjwvYT4=
|
|
24
|
-
* setDataURLPrefix(data, 'image/png', false); // data:image/png,PGEgaWQ9ImEiPjxiIGlkPSJiIj5oZXkhPC9iPjwvYT4=
|
|
25
|
-
* setDataURLPrefix(data, 'image/jpg'); // data:image/jpg;base64,PGEgaWQ9ImEiPjxiIGlkPSJiIj5oZXkhPC9iPjwvYT4=
|
|
26
|
-
* setDataURLPrefix(data, 'text/html'); // data:text/html;base64,PGEgaWQ9ImEiPjxiIGlkPSJiIj5oZXkhPC9iPjwvYT4=
|
|
27
|
-
* setDataURLPrefix(data, ''); // data:;base64,PGEgaWQ9ImEiPjxiIGlkPSJiIj5oZXkhPC9iPjwvYT4=
|
|
28
|
-
* setDataURLPrefix(data, '', false); // data:,PGEgaWQ9ImEiPjxiIGlkPSJiIj5oZXkhPC9iPjwvYT4=
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
function setDataURLPrefix(data) {
|
|
32
|
-
var mimetype = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'image/png';
|
|
33
|
-
var base64 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
34
|
-
return "data:".concat(mimetype).concat(base64 ? ';base64' : '', ",").concat(data);
|
|
3
|
+
function setDataURLPrefix(data, mimeType, base64) {
|
|
4
|
+
if (mimeType === void 0) { mimeType = 'image/png'; }
|
|
5
|
+
if (base64 === void 0) { base64 = true; }
|
|
6
|
+
return "data:".concat(mimeType).concat(base64 ? ';base64' : '', ",").concat(data);
|
|
35
7
|
}
|
|
36
|
-
|
|
37
|
-
exports
|
|
8
|
+
|
|
9
|
+
module.exports = setDataURLPrefix;
|
package/lib/strlen.js
CHANGED
|
@@ -1,41 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var normalizeString = require('./normalizeString.js');
|
|
2
4
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _normalizeString = _interopRequireDefault(require("./normalizeString"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
|
-
/**
|
|
10
|
-
* 获取字符长度。中文汉字占2个字符,英文占1个字符,特殊如emoji占4个字符。
|
|
11
|
-
*
|
|
12
|
-
* @static
|
|
13
|
-
* @alias module:Other.strlen
|
|
14
|
-
* @since 4.10.0
|
|
15
|
-
* @param {string} str 字符串
|
|
16
|
-
* @returns {number} 字符长度
|
|
17
|
-
* @example
|
|
18
|
-
*
|
|
19
|
-
* strlen('你好a'); // 5
|
|
20
|
-
* strlen('你好,世界!'); // 12
|
|
21
|
-
* strlen('严両丞丽'); // 8
|
|
22
|
-
* strlen('abcde'); // 5
|
|
23
|
-
* strlen('𠮷'); // 4
|
|
24
|
-
* strlen('🍎'); // 4
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
5
|
function strlen(str) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
6
|
+
var realStr = normalizeString(str);
|
|
7
|
+
var len = 0;
|
|
8
|
+
for (var i = 0; i < realStr.length; i++) {
|
|
9
|
+
var c = realStr.charCodeAt(i);
|
|
10
|
+
if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
|
|
11
|
+
len++;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
len += 2;
|
|
15
|
+
}
|
|
36
16
|
}
|
|
37
|
-
|
|
38
|
-
return len;
|
|
17
|
+
return len;
|
|
39
18
|
}
|
|
40
|
-
|
|
41
|
-
exports
|
|
19
|
+
|
|
20
|
+
module.exports = strlen;
|
package/lib/times.js
CHANGED
|
@@ -1,56 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _math = require("./utils/math.util");
|
|
8
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
-
/**
|
|
15
|
-
* 精确乘法,支持多个数相乘,乘数默认为 1 。
|
|
16
|
-
*
|
|
17
|
-
* @static
|
|
18
|
-
* @alias module:Math.times
|
|
19
|
-
* @since 3.1.0
|
|
20
|
-
* @param {...number|string} nums 相乘的数
|
|
21
|
-
* @returns {number} 乘积
|
|
22
|
-
* @example
|
|
23
|
-
*
|
|
24
|
-
* times(3, 0.6); // 1.8
|
|
25
|
-
* times(3, 0.6, 2); // 3.6
|
|
26
|
-
* times(3, 0.6, 2, 10); // 36
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
function times() {
|
|
30
|
-
for (var _len = arguments.length, nums = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
|
-
nums[_key] = arguments[_key];
|
|
32
|
-
}
|
|
33
|
-
var num1 = nums[0],
|
|
34
|
-
_nums$ = nums[1],
|
|
35
|
-
num2 = _nums$ === void 0 ? 1 : _nums$,
|
|
36
|
-
rest = nums.slice(2);
|
|
37
|
-
if (rest.length > 0) {
|
|
38
|
-
return times.apply(void 0, [times(num1, num2)].concat(_toConsumableArray(rest)));
|
|
39
|
-
}
|
|
40
|
-
num1 = (0, _math.transformEffectiveNumber)(num1);
|
|
41
|
-
num2 = (0, _math.transformEffectiveNumber)(num2);
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var math_util = require('./utils/math.util.js');
|
|
5
|
+
var isNaN = require('./utils/type/isNaN.js');
|
|
42
6
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
7
|
+
function times() {
|
|
8
|
+
var nums = [];
|
|
9
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
10
|
+
nums[_i] = arguments[_i];
|
|
11
|
+
}
|
|
12
|
+
var _a = tslib.__read(nums), num1 = _a[0], _b = _a[1], num2 = _b === void 0 ? 1 : _b, rest = _a.slice(2);
|
|
13
|
+
if (rest.length > 0) {
|
|
14
|
+
return times.apply(void 0, tslib.__spreadArray([times(num1, num2)], tslib.__read(rest), false));
|
|
15
|
+
}
|
|
16
|
+
num1 = math_util.transformEffectiveNumber(num1);
|
|
17
|
+
num2 = math_util.transformEffectiveNumber(num2);
|
|
18
|
+
if (isNaN(num1) || isNaN(num2)) {
|
|
19
|
+
return Number.NaN;
|
|
20
|
+
}
|
|
21
|
+
var num1Changed = math_util.float2Fixed(num1);
|
|
22
|
+
var num2Changed = math_util.float2Fixed(num2);
|
|
23
|
+
var baseNum = math_util.digitLength(num1) + math_util.digitLength(num2);
|
|
24
|
+
var leftValue = num1Changed * num2Changed;
|
|
25
|
+
math_util.checkBoundary(leftValue);
|
|
26
|
+
return leftValue / Math.pow(10, baseNum);
|
|
54
27
|
}
|
|
55
|
-
|
|
56
|
-
exports
|
|
28
|
+
|
|
29
|
+
module.exports = times;
|