util-helpers 4.19.2 → 4.19.4

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/esm/VERSION.js CHANGED
@@ -1,4 +1,4 @@
1
- var VERSION = "4.19.2";
1
+ var VERSION = "4.19.4";
2
2
  var VERSION$1 = VERSION;
3
3
 
4
4
  export { VERSION$1 as default };
@@ -41,6 +41,7 @@ function formatDec(decStr, precision, decimal) {
41
41
  return decimal + ret;
42
42
  }
43
43
  var formatMoney = function (num, options) {
44
+ if (num === void 0) { num = ''; }
44
45
  if (options === void 0) { options = {}; }
45
46
  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;
46
47
  if (!checkNumber(num)) {
package/esm/index.js CHANGED
@@ -57,6 +57,6 @@ export { default as findTreeSelect } from './findTreeSelect.js';
57
57
  export { setDisableWarning } from './utils/config.js';
58
58
  export { default as VERSION } from './VERSION.js';
59
59
 
60
- var version = "4.19.2";
60
+ var version = "4.19.4";
61
61
 
62
62
  export { version };
@@ -61,7 +61,7 @@ function convertDecimal(num) {
61
61
  var ret = '';
62
62
  if (index > -1) {
63
63
  var decimalStr = strNum.slice(index + 1);
64
- ret = mapNumberChar(parseInt(decimalStr));
64
+ ret = mapNumberChar(decimalStr);
65
65
  }
66
66
  return ret;
67
67
  }
@@ -1,6 +1,7 @@
1
1
  import { toString } from 'ut2';
2
2
 
3
3
  function replaceChar(str, options) {
4
+ if (str === void 0) { str = ''; }
4
5
  if (options === void 0) { options = {}; }
5
6
  var _a = options.char, char = _a === void 0 ? '*' : _a, exclude = options.exclude;
6
7
  var _b = options.start, start = _b === void 0 ? 3 : _b, _c = options.end, end = _c === void 0 ? -4 : _c, repeat = options.repeat;
package/lib/VERSION.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var VERSION = "4.19.2";
3
+ var VERSION = "4.19.4";
4
4
  var VERSION$1 = VERSION;
5
5
 
6
6
  module.exports = VERSION$1;
@@ -43,6 +43,7 @@ function formatDec(decStr, precision, decimal) {
43
43
  return decimal + ret;
44
44
  }
45
45
  var formatMoney = function (num, options) {
46
+ if (num === void 0) { num = ''; }
46
47
  if (options === void 0) { options = {}; }
47
48
  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;
48
49
  if (!checkNumber(num)) {
package/lib/index.js CHANGED
@@ -59,7 +59,7 @@ var findTreeSelect = require('./findTreeSelect.js');
59
59
  var config = require('./utils/config.js');
60
60
  var VERSION = require('./VERSION.js');
61
61
 
62
- exports.version = "4.19.2";
62
+ exports.version = "4.19.4";
63
63
 
64
64
  exports.isMobile = isMobile;
65
65
  exports.isTelephone = isTelephone;
@@ -63,7 +63,7 @@ function convertDecimal(num) {
63
63
  var ret = '';
64
64
  if (index > -1) {
65
65
  var decimalStr = strNum.slice(index + 1);
66
- ret = mapNumberChar(parseInt(decimalStr));
66
+ ret = mapNumberChar(decimalStr);
67
67
  }
68
68
  return ret;
69
69
  }
@@ -3,6 +3,7 @@
3
3
  var ut2 = require('ut2');
4
4
 
5
5
  function replaceChar(str, options) {
6
+ if (str === void 0) { str = ''; }
6
7
  if (options === void 0) { options = {}; }
7
8
  var _a = options.char, char = _a === void 0 ? '*' : _a, exclude = options.exclude;
8
9
  var _b = options.start, start = _b === void 0 ? 3 : _b, _c = options.end, end = _c === void 0 ? -4 : _c, repeat = options.repeat;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "util-helpers",
3
- "version": "4.19.2",
3
+ "version": "4.19.4",
4
4
  "description": "一个基于业务场景的工具方法库",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",
@@ -55,11 +55,11 @@
55
55
  "@babel/preset-typescript": "^7.22.5",
56
56
  "@commitlint/cli": "^17.6.6",
57
57
  "@commitlint/config-conventional": "^17.6.6",
58
- "@rollup/plugin-commonjs": "^25.0.2",
58
+ "@rollup/plugin-commonjs": "^25.0.3",
59
59
  "@rollup/plugin-node-resolve": "^15.1.0",
60
60
  "@rollup/plugin-replace": "^5.0.2",
61
61
  "@rollup/plugin-terser": "^0.4.3",
62
- "@rollup/plugin-typescript": "^11.1.1",
62
+ "@rollup/plugin-typescript": "^11.1.2",
63
63
  "@types/jest": "^29.5.2",
64
64
  "@typescript-eslint/eslint-plugin": "^5.60.1",
65
65
  "@typescript-eslint/parser": "^5.60.1",
@@ -68,14 +68,14 @@
68
68
  "cross-env": "^7.0.3",
69
69
  "cz-conventional-changelog": "^3.3.0",
70
70
  "docdash": "^2.0.1",
71
- "eslint": "^8.43.0",
71
+ "eslint": "^8.44.0",
72
72
  "jest": "^29.5.0",
73
73
  "jest-environment-jsdom": "^29.5.0",
74
74
  "jsdoc": "^4.0.2",
75
- "lint-staged": "^13.2.2",
75
+ "lint-staged": "^13.2.3",
76
76
  "prettier": "^2.8.8",
77
- "rollup": "^3.25.3",
78
- "typescript": "^5.1.3",
77
+ "rollup": "^3.26.3",
78
+ "typescript": "^5.1.6",
79
79
  "yorkie": "^2.0.0"
80
80
  },
81
81
  "lint-staged": {
@@ -93,6 +93,6 @@
93
93
  },
94
94
  "dependencies": {
95
95
  "tslib": "^2.6.0",
96
- "ut2": "^1.1.0"
96
+ "ut2": "^1.3.2"
97
97
  }
98
98
  }
@@ -36,6 +36,7 @@ type DownloadOptions = {
36
36
  * @static
37
37
  * @alias module:Other.download
38
38
  * @since 4.16.0
39
+ * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Access-Control-Expose-Headers | Access-Control-Expose-Headers}
39
40
  * @see {@link https://zh.wikipedia.org/wiki/多用途互聯網郵件擴展 | MIME}
40
41
  * @see {@link https://9ykc9s.csb.app/ | 在线示例}
41
42
  * @param {string|Blob|ArrayBuffer|TypedArray} data 字符串、blob数据或url地址
@@ -30,5 +30,5 @@ type Options = {
30
30
  * formatBankCard('6228480402564890', {spaceMark: '-'}); // 6228-4804-0256-4890
31
31
  *
32
32
  */
33
- declare function formatBankCard(bankCardNo?: string, options?: Options): any;
33
+ declare function formatBankCard(bankCardNo?: string, options?: Options): string;
34
34
  export default formatBankCard;
@@ -28,5 +28,5 @@ type Options = {
28
28
  * formatMobile('13345678'); // 133 4567 8
29
29
  *
30
30
  */
31
- declare function formatMobile(mobileNo?: string, options?: Options): any;
31
+ declare function formatMobile(mobileNo?: string, options?: Options): string;
32
32
  export default formatMobile;
@@ -43,5 +43,5 @@ type Options = {
43
43
  * // 字符串数字
44
44
  * formatMoney('3000.03', { precision: 4 }); // 3,000.0300
45
45
  */
46
- declare const formatMoney: (num: string | number, options?: Options) => string;
46
+ declare const formatMoney: (num?: string | number, options?: Options) => string;
47
47
  export default formatMoney;
@@ -22,5 +22,5 @@
22
22
  * normalizeString('a'); // 'a'
23
23
  *
24
24
  */
25
- declare function normalizeString(value: any): any;
25
+ declare function normalizeString(value: any): string;
26
26
  export default normalizeString;
@@ -21,5 +21,5 @@
21
21
  * padZero('688', 5); // 00688
22
22
  *
23
23
  */
24
- declare function padZero(value: string | number, size?: number): any;
24
+ declare function padZero(value: string | number, size?: number): string;
25
25
  export default padZero;
@@ -50,8 +50,8 @@ type Options = {
50
50
  * // 用户名
51
51
  * replaceChar('林某某', {start: 1, end: Infinity, repeat: 2}); // 林**
52
52
  * replaceChar('林某', {start: 1, end: Infinity, repeat: 2}); // 林**
53
- * replaceChar('林某某某', {start: 1, end: Infinity, repeat: 2}); // 林**
53
+ * replaceChar('林某某某', { start: 1, end: -1, repeat: 1 }); // 林*某
54
54
  *
55
55
  */
56
- declare function replaceChar(str: string, options?: Options): any;
56
+ declare function replaceChar(str?: string, options?: Options): string;
57
57
  export default replaceChar;