util-helpers 4.0.7 → 4.0.8
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 +94 -41
- package/dist/util-helpers.min.js +1 -1
- package/dist/util-helpers.min.js.map +1 -1
- package/esm/divide.js +17 -8
- package/esm/formatBankCard.js +1 -1
- package/esm/formatMoney.js +7 -5
- package/esm/isBusinessLicense.js +2 -2
- package/esm/isSocialCreditCode.js +2 -2
- package/esm/minus.js +17 -8
- package/esm/parseIdCard.js +1 -1
- package/esm/plus.js +17 -8
- package/esm/replaceChar.js +1 -1
- package/esm/times.js +17 -8
- package/esm/utils/convertToString.js +1 -1
- package/esm/utils/math.util.js +4 -5
- package/lib/divide.js +29 -8
- package/lib/formatBankCard.js +1 -1
- package/lib/formatMoney.js +6 -5
- package/lib/isBusinessLicense.js +2 -2
- package/lib/isSocialCreditCode.js +2 -2
- package/lib/minus.js +29 -8
- package/lib/parseIdCard.js +1 -1
- package/lib/plus.js +29 -8
- package/lib/replaceChar.js +1 -1
- package/lib/times.js +29 -8
- package/lib/utils/convertToString.js +1 -1
- package/lib/utils/math.util.js +4 -3
- package/package.json +2 -2
- package/types/divide.d.ts +2 -4
- package/types/minus.d.ts +2 -4
- package/types/plus.d.ts +2 -4
- package/types/times.d.ts +2 -4
- package/types/utils/convertToString.d.ts +2 -2
- package/types/utils/math.util.d.ts +7 -0
package/types/minus.d.ts
CHANGED
|
@@ -5,9 +5,7 @@ export default minus;
|
|
|
5
5
|
* @static
|
|
6
6
|
* @alias module:Math.minus
|
|
7
7
|
* @since 3.1.0
|
|
8
|
-
* @param {number|string}
|
|
9
|
-
* @param {number|string} num2 相减的第二个数
|
|
10
|
-
* @param {...number|string} others 相减的第其余数
|
|
8
|
+
* @param {...number|string} nums 相减的数
|
|
11
9
|
* @returns {number} 差
|
|
12
10
|
* @example
|
|
13
11
|
*
|
|
@@ -20,4 +18,4 @@ export default minus;
|
|
|
20
18
|
* minus(1, 0.9, 0.02, 0.08);
|
|
21
19
|
* // => 0
|
|
22
20
|
*/
|
|
23
|
-
declare function minus(
|
|
21
|
+
declare function minus(...nums: (number | string)[]): number;
|
package/types/plus.d.ts
CHANGED
|
@@ -5,9 +5,7 @@ export default plus;
|
|
|
5
5
|
* @static
|
|
6
6
|
* @alias module:Math.plus
|
|
7
7
|
* @since 3.1.0
|
|
8
|
-
* @param {number|string}
|
|
9
|
-
* @param {number|string} num2 相加的第二个数
|
|
10
|
-
* @param {...number|string} others 相加的其余数
|
|
8
|
+
* @param {...number|string} nums 相加的数
|
|
11
9
|
* @returns {number} 总和
|
|
12
10
|
* @example
|
|
13
11
|
*
|
|
@@ -20,4 +18,4 @@ export default plus;
|
|
|
20
18
|
* plus(0.1, 0.2, 0.3, 0.4);
|
|
21
19
|
* // => 1
|
|
22
20
|
*/
|
|
23
|
-
declare function plus(
|
|
21
|
+
declare function plus(...nums: (number | string)[]): number;
|
package/types/times.d.ts
CHANGED
|
@@ -5,9 +5,7 @@ export default times;
|
|
|
5
5
|
* @static
|
|
6
6
|
* @alias module:Math.times
|
|
7
7
|
* @since 3.1.0
|
|
8
|
-
* @param {number|string}
|
|
9
|
-
* @param {number|string} num2 相乘的第二个数
|
|
10
|
-
* @param {...number|string} others 相乘的其余数
|
|
8
|
+
* @param {...number|string} nums 相乘的数
|
|
11
9
|
* @returns {number} 乘积
|
|
12
10
|
* @example
|
|
13
11
|
*
|
|
@@ -20,4 +18,4 @@ export default times;
|
|
|
20
18
|
* times(3, 0.6, 2, 10);
|
|
21
19
|
* // => 36
|
|
22
20
|
*/
|
|
23
|
-
declare function times(
|
|
21
|
+
declare function times(...nums: (number | string)[]): number;
|
|
@@ -36,6 +36,13 @@ export function float2Fixed(num: number | string): number;
|
|
|
36
36
|
* @returns
|
|
37
37
|
*/
|
|
38
38
|
export function checkBoundary(num: number): void;
|
|
39
|
+
/**
|
|
40
|
+
* 去掉左边数字0
|
|
41
|
+
*
|
|
42
|
+
* @param {string} num 数字字符串
|
|
43
|
+
* @returns {string}
|
|
44
|
+
*/
|
|
45
|
+
export function trimLeftZero(num: string): string;
|
|
39
46
|
/**
|
|
40
47
|
* 科学计数法转换成普通数字
|
|
41
48
|
*
|