util-helpers 5.2.0 → 5.2.2

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.
Files changed (85) hide show
  1. package/README.md +18 -17
  2. package/dist/util-helpers.js +78 -73
  3. package/dist/util-helpers.js.map +1 -1
  4. package/dist/util-helpers.min.js +1 -1
  5. package/dist/util-helpers.min.js.map +1 -1
  6. package/esm/VERSION.js +1 -1
  7. package/esm/checkFileType.js +6 -4
  8. package/esm/getFileType.js +2 -2
  9. package/esm/getMimeType.js +2 -2
  10. package/esm/index.js +3 -3
  11. package/esm/utils/file.util.js +7 -4
  12. package/lib/VERSION.js +1 -1
  13. package/lib/checkFileType.js +6 -4
  14. package/lib/getFileType.js +2 -2
  15. package/lib/getMimeType.js +2 -2
  16. package/lib/index.js +6 -6
  17. package/lib/utils/file.util.js +6 -2
  18. package/package.json +1 -1
  19. package/types/AsyncMemo.d.ts +1 -1
  20. package/types/VERSION.d.ts +1 -3
  21. package/types/ajax.d.ts +19 -3
  22. package/types/bytesToSize.d.ts +0 -1
  23. package/types/calculateCursorPosition.d.ts +0 -1
  24. package/types/checkFileType.d.ts +3 -2
  25. package/types/compressImage.d.ts +1 -1
  26. package/types/dataURLToBlob.d.ts +1 -2
  27. package/types/divide.d.ts +0 -1
  28. package/types/download.d.ts +7 -21
  29. package/types/fileReader.d.ts +1 -1
  30. package/types/filterTree.d.ts +0 -1
  31. package/types/findTreeNode.d.ts +0 -1
  32. package/types/findTreeNodes.d.ts +0 -1
  33. package/types/findTreeSelect.d.ts +0 -1
  34. package/types/formatBankCard.d.ts +0 -1
  35. package/types/formatMobile.d.ts +0 -1
  36. package/types/formatMoney.d.ts +0 -1
  37. package/types/gcd.d.ts +0 -1
  38. package/types/getFileBlob.d.ts +1 -2
  39. package/types/getFileType.d.ts +13 -4
  40. package/types/getImageInfo.d.ts +14 -5
  41. package/types/getMimeType.d.ts +41 -4
  42. package/types/index.d.ts +12 -10
  43. package/types/isBankCard.d.ts +0 -1
  44. package/types/isBusinessLicense.d.ts +0 -1
  45. package/types/isChinese.d.ts +0 -1
  46. package/types/isEmail.d.ts +0 -1
  47. package/types/isHMCard.d.ts +0 -1
  48. package/types/isIPv4.d.ts +0 -1
  49. package/types/isIPv6.d.ts +0 -1
  50. package/types/isIdCard.d.ts +0 -1
  51. package/types/isMobile.d.ts +0 -1
  52. package/types/isPassport.d.ts +0 -1
  53. package/types/isPassword.d.ts +0 -1
  54. package/types/isPostcode.d.ts +0 -1
  55. package/types/isQQ.d.ts +0 -1
  56. package/types/isSocialCreditCode.d.ts +0 -1
  57. package/types/isSwiftCode.d.ts +0 -1
  58. package/types/isTWCard.d.ts +0 -1
  59. package/types/isTelephone.d.ts +0 -1
  60. package/types/isUrl.d.ts +0 -1
  61. package/types/isValidNumber.d.ts +0 -1
  62. package/types/isVehicle.d.ts +0 -1
  63. package/types/isWX.d.ts +0 -1
  64. package/types/lcm.d.ts +0 -1
  65. package/types/listToTree.d.ts +0 -1
  66. package/types/loadImage.d.ts +1 -2
  67. package/types/loadImageWithBlob.d.ts +3 -2
  68. package/types/loadScript.d.ts +1 -2
  69. package/types/minus.d.ts +0 -1
  70. package/types/numberToChinese.d.ts +0 -1
  71. package/types/padZero.d.ts +0 -1
  72. package/types/parseIdCard.d.ts +0 -1
  73. package/types/plus.d.ts +0 -1
  74. package/types/replaceChar.d.ts +0 -1
  75. package/types/round.d.ts +0 -1
  76. package/types/setDataURLPrefix.d.ts +0 -1
  77. package/types/strlen.d.ts +0 -1
  78. package/types/times.d.ts +0 -1
  79. package/types/transformFieldNames.d.ts +0 -1
  80. package/types/transformObjectValue.d.ts +0 -1
  81. package/types/treeToList.d.ts +0 -1
  82. package/types/utils/config.d.ts +0 -1
  83. package/types/utils/file.util.d.ts +4 -1
  84. package/types/validatePassword.d.ts +0 -1
  85. package/types/BlobUrl.d.ts +0 -41
package/types/index.d.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  * 数据验证
3
3
  *
4
4
  * @module Validator
5
- * @since 1.1.0
6
5
  */
7
6
  export { default as isMobile } from './isMobile';
8
7
  export { default as isTelephone } from './isTelephone';
@@ -30,7 +29,6 @@ export { default as isValidNumber } from './isValidNumber';
30
29
  * 数据处理
31
30
  *
32
31
  * @module Processor
33
- * @since 1.1.0
34
32
  */
35
33
  export { default as formatMoney } from './formatMoney';
36
34
  export { default as formatBankCard } from './formatBankCard';
@@ -38,8 +36,6 @@ export { default as replaceChar } from './replaceChar';
38
36
  export { default as numberToChinese } from './numberToChinese';
39
37
  export { default as bytesToSize } from './bytesToSize';
40
38
  export { default as parseIdCard } from './parseIdCard';
41
- export { default as fileReader } from './fileReader';
42
- export { default as dataURLToBlob } from './dataURLToBlob';
43
39
  export { default as setDataURLPrefix } from './setDataURLPrefix';
44
40
  export { default as safeDate } from './safeDate';
45
41
  export { default as formatMobile } from './formatMobile';
@@ -49,7 +45,6 @@ export { default as transformObjectValue } from './transformObjectValue';
49
45
  * 数学计算,修正浮点数计算问题
50
46
  *
51
47
  * @module Math
52
- * @since 3.1.0
53
48
  * @see {@link https://github.com/camsong/blog/issues/9 | JavaScript 浮点数陷阱及解法}
54
49
  * @see {@link https://2zbuy.csb.app/ | JS浮点数计算测试}
55
50
  * @example
@@ -92,16 +87,18 @@ export { default as round } from './round';
92
87
  export { default as gcd } from './gcd';
93
88
  export { default as lcm } from './lcm';
94
89
  /**
95
- * 其他
90
+ * 浏览器
96
91
  *
97
- * @module Other
98
- * @since 4.2.0
92
+ * <em style="font-weight: bold;">下列方法仅适用于浏览器端。</em>
93
+ *
94
+ * @module Browser
99
95
  */
100
96
  export { default as ajax } from './ajax';
101
- export { default as calculateCursorPosition } from './calculateCursorPosition';
102
97
  export { default as checkFileType } from './checkFileType';
103
98
  export { default as compressImage } from './compressImage';
99
+ export { default as dataURLToBlob } from './dataURLToBlob';
104
100
  export { default as download } from './download';
101
+ export { default as fileReader } from './fileReader';
105
102
  export { default as getFileBlob } from './getFileBlob';
106
103
  export { default as getFileType } from './getFileType';
107
104
  export { default as getImageInfo } from './getImageInfo';
@@ -109,13 +106,18 @@ export { default as getMimeType } from './getMimeType';
109
106
  export { default as loadImage } from './loadImage';
110
107
  export { default as loadImageWithBlob } from './loadImageWithBlob';
111
108
  export { default as loadScript } from './loadScript';
109
+ /**
110
+ * 其他
111
+ *
112
+ * @module Other
113
+ */
114
+ export { default as calculateCursorPosition } from './calculateCursorPosition';
112
115
  export { default as randomString } from './randomString';
113
116
  export { default as strlen } from './strlen';
114
117
  /**
115
118
  * 树结构数据查询、过滤、转换等处理方法
116
119
  *
117
120
  * @module Tree
118
- * @since 4.14.0
119
121
  */
120
122
  export { default as transformFieldNames } from './transformFieldNames';
121
123
  export { default as listToTree } from './listToTree';
@@ -5,7 +5,6 @@ type Options = {
5
5
  /**
6
6
  * 检测值是否为银行卡号。正常模式(非0开头,10-21位数字)宽松模式(8-30位数字)
7
7
  *
8
- * @static
9
8
  * @alias module:Validator.isBankCard
10
9
  * @since 1.1.0
11
10
  * @see {@link https://kf.qq.com/faq/170112ABnm6b170112FvquAn.html | 常用银行账号位数参考}
@@ -4,7 +4,6 @@ type Options = {
4
4
  /**
5
5
  * 检测值是否为营业执照号,也叫工商注册号。由14位数字本体码和1位数字校验码组成,其中本体码从左至右依次为:6位首次登记机关码、8位顺序码。
6
6
  *
7
- * @static
8
7
  * @alias module:Validator.isBusinessLicense
9
8
  * @since 3.5.0
10
9
  * @see {@link https://wenku.baidu.com/view/19873704cc1755270722087c.html | GS15—2006 工商行政管理市场主体注册号编制规则}
@@ -5,7 +5,6 @@ type Options = {
5
5
  /**
6
6
  * 检测值是否为中文
7
7
  *
8
- * @static
9
8
  * @alias module:Validator.isChinese
10
9
  * @since 1.1.0
11
10
  * @see {@link http://www.unicode.org/reports/tr38/#BlockListing | 4.4 Listing of Characters Covered by the Unihan Database}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为Email
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isEmail
6
5
  * @since 1.1.0
7
6
  * @param {*} value 要检测的值
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为港澳居民来往内地通行证,俗称回乡证或回乡卡。
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isHMCard
6
5
  * @since 4.0.0
7
6
  * @see {@link https://zh.wikipedia.org/wiki/港澳居民来往内地通行证 | 港澳居民来往内地通行证}
package/types/isIPv4.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为ipv4
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isIPv4
6
5
  * @since 1.1.0
7
6
  * @param {*} value 要检测的值
package/types/isIPv6.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为ipv6
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isIPv6
6
5
  * @since 1.1.0
7
6
  * @param {*} value 要检测的值
@@ -7,7 +7,6 @@ type Options = {
7
7
  *
8
8
  * 宽松模式下,支持15位身份证号码。
9
9
  *
10
- * @static
11
10
  * @alias module:Validator.isIdCard
12
11
  * @since 1.1.0
13
12
  * @see {@link https://zh.wikipedia.org/wiki/中华人民共和国公民身份号码 | 中华人民共和国公民身份号码}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为手机号码
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isMobile
6
5
  * @since 1.1.0
7
6
  * @param {*} value 要检测的值
@@ -2,7 +2,6 @@
2
2
  * 检测值是否为护照号
3
3
  * 支持普通护照(E*)、外交护照(DE)、公务护照(SE)、公务普通护照(PE)、香港特区护照(K/KJ/H*)、澳门特区护照(MA/MB/M*),注意不区分大小写
4
4
  *
5
- * @static
6
5
  * @alias module:Validator.isPassport
7
6
  * @since 1.1.0
8
7
  * @see {@link https://zh.wikipedia.org/wiki/中华人民共和国护照#个人资料页 | 中华人民共和国护照#个人资料页}
@@ -4,7 +4,6 @@ import validatePassword from './validatePassword';
4
4
  * <p><strong>注意:该校验只校验是否存在不同字符(大小写字母、数字、特殊符号),不判断长度。</strong></p>
5
5
  * <p><i>如果需要更细致的验证,请使用 <a href="#.validatePassword">validatePassword</a></i></p>
6
6
  *
7
- * @static
8
7
  * @alias module:Validator.isPassword
9
8
  * @requires module:Validator.validatePassword
10
9
  * @since 1.1.0
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为邮政编码,6位数字
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isPostcode
6
5
  * @since 1.1.0
7
6
  * @param {*} value 要检测的值
package/types/isQQ.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为QQ号,非0开头,5至11位数字
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isQQ
6
5
  * @since 1.1.0
7
6
  * @param {*} value 要检测的值
@@ -4,7 +4,6 @@ type Options = {
4
4
  /**
5
5
  * 检测值是否为统一社会信用代码,也叫三证合一组织代码。由18位数字和大写字母组成,不使用I、O、Z、S、V。
6
6
  *
7
- * @static
8
7
  * @alias module:Validator.isSocialCreditCode
9
8
  * @since 1.1.0
10
9
  * @see {@link https://zh.wikisource.org/zh-hans/GB_32100-2015_法人和其他组织统一社会信用代码编码规则 | GB 32100-2015 法人和其他组织统一社会信用代码编码规则}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为 Swift Code。8位或11位,前6位为大写字母,7-8位为大写字母或数字,9-11位为可选的大写字母或数字。
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isSwiftCode
6
5
  * @since 4.9.0
7
6
  * @see {@link https://zh.wikipedia.org/wiki/ISO_9362 | ISO 9362}
@@ -4,7 +4,6 @@ type Options = {
4
4
  /**
5
5
  * 检测值是否为台湾居民来往大陆通行证,俗称台胞证。
6
6
  *
7
- * @static
8
7
  * @alias module:Validator.isTWCard
9
8
  * @since 4.0.0
10
9
  * @see {@link https://zh.wikipedia.org/wiki/台湾居民来往大陆通行证 | 台湾居民来往大陆通行证}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为固定电话
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isTelephone
6
5
  * @since 1.1.0
7
6
  * @param {*} value 要检测的值
package/types/isUrl.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为url
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isUrl
6
5
  * @since 3.4.0
7
6
  * @see {@link https://zh.wikipedia.org/wiki/统一资源定位符 | 统一资源定位符}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为有效数值,支持隐式转换。如果返回 true ,表示可以通过 Number() 转为数字。
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isValidNumber
6
5
  * @since 4.17.2
7
6
  * @param {*} value 待检测的值
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为车牌号,支持新能源和非新能源车牌
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isVehicle
6
5
  * @since 1.1.0
7
6
  * @see {@link https://baike.baidu.com/item/车牌号 | 车牌号}
package/types/isWX.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 检测值是否为微信号
3
3
  *
4
- * @static
5
4
  * @alias module:Validator.isWX
6
5
  * @since 1.1.0
7
6
  * @param {*} value 要检测的值
package/types/lcm.d.ts CHANGED
@@ -11,7 +11,6 @@
11
11
  * 6. 如果参数为负数,将转为绝对值的正数。
12
12
  * 7. 如果参数包含小数点,将转为四舍五入的整数。
13
13
  *
14
- * @static
15
14
  * @alias module:Math.lcm
16
15
  * @since 4.20.0
17
16
  * @see {@link https://baike.baidu.com/item/最小公倍数 | 最小公倍数}
@@ -9,7 +9,6 @@ type Options = {
9
9
  /**
10
10
  * 列表数据转树结构
11
11
  *
12
- * @static
13
12
  * @alias module:Tree.listToTree
14
13
  * @since 4.14.0
15
14
  * @param {Object[]} list 列表数据
@@ -3,8 +3,7 @@
3
3
  *
4
4
  * <em style="font-weight: bold;">注意:该方法仅适用于浏览器端。</em>
5
5
  *
6
- * @static
7
- * @alias module:Other.loadImage
6
+ * @alias module:Browser.loadImage
8
7
  * @since 4.20.0
9
8
  * @param {string | Blob} img 图片地址或 blob 对象
10
9
  * @returns {Promise<HTMLImageElement>} HTML图片元素
@@ -12,7 +12,7 @@ import getFileBlob from './getFileBlob';
12
12
  * <em style="font-weight: bold;">注意:该方法仅适用于浏览器端。</em>
13
13
  *
14
14
  * @method
15
- * @alias module:Other.loadImageWithBlob
15
+ * @alias module:Browser.loadImageWithBlob
16
16
  * @since 4.20.0
17
17
  * @param {string | Blob} img 图片地址或 blob 对象
18
18
  * @param {AjaxOptions} [ajaxOptions] ajax 请求配置项,当传入的图片为字符串时才会触发请求。
@@ -20,7 +20,8 @@ import getFileBlob from './getFileBlob';
20
20
  * @example
21
21
  *
22
22
  * loadImage(file).then(({image, blob})=>{
23
- * // do something
23
+ * console.log(image, blob);
24
+ * // HTMLImageElement {} Blob {}
24
25
  * });
25
26
  *
26
27
  * loadImage('https://dummyimage.com/200x300').then(({image, blob})=>{
@@ -7,8 +7,7 @@ type ScriptAttribute = Pick<HTMLScriptElement, 'async' | 'crossOrigin' | 'defer'
7
7
  *
8
8
  * <em style="font-weight: bold;">注意:该方法仅适用于浏览器端。</em>
9
9
  *
10
- * @static
11
- * @alias module:Other.loadScript
10
+ * @alias module:Browser.loadScript
12
11
  * @since 4.19.0
13
12
  * @param {string} src js 地址。
14
13
  * @param {Object} [options] script 标签属性。比如 `defer` `onload` `onerror` `id` 等,下面列举部分带有默认值或额外扩展的配置。
package/types/minus.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 精确减法,支持多个数相减,减数默认为 0 。
3
3
  *
4
- * @static
5
4
  * @alias module:Math.minus
6
5
  * @since 3.1.0
7
6
  * @param {...(number|string)} nums 相减的数
@@ -14,7 +14,6 @@ type Options = {
14
14
  *
15
15
  * 如果数字不在安全数字 -9007199254740991~9007199254740991 范围内,处理会有异常。
16
16
  *
17
- * @static
18
17
  * @alias module:Processor.numberToChinese
19
18
  * @since 1.2.0
20
19
  * @see {@link https://openstd.samr.gov.cn/bzgk/gb/newGbInfo?hcno=F5DAC3377DA99C8D78AE66735B6359C7 | 出版物上数字用法}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 前置补零
3
3
  *
4
- * @static
5
4
  * @alias module:Processor.padZero
6
5
  * @since 4.7.0
7
6
  * @param {string|number} value 要处理的值
@@ -33,7 +33,6 @@ type IdCardInfo = {
33
33
  /**
34
34
  * 解析身份证号码,支持15、18位身份证号码
35
35
  *
36
- * @static
37
36
  * @alias module:Processor.parseIdCard
38
37
  * @since 4.0.0
39
38
  * @see {@link https://baike.baidu.com/item/居民身份证号码 | 居民身份证号码}
package/types/plus.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 精确加法,支持多个数相加,加数默认为 0 。
3
3
  *
4
- * @static
5
4
  * @alias module:Math.plus
6
5
  * @since 3.1.0
7
6
  * @param {...(number|string)} nums 相加的数
@@ -8,7 +8,6 @@ type Options = {
8
8
  /**
9
9
  * 替换字符,应用场景如:脱敏
10
10
  *
11
- * @static
12
11
  * @alias module:Processor.replaceChar
13
12
  * @since 1.1.0
14
13
  * @param {string} str 要处理的字符串
package/types/round.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 四舍五入,支持设置精度
3
3
  *
4
- * @static
5
4
  * @alias module:Math.round
6
5
  * @since 3.1.0
7
6
  * @param {number|string} num 要四舍五入的数字
@@ -3,7 +3,6 @@
3
3
  *
4
4
  * 如果你需要获取DataURL 的 MIME 类型和数据本身,推荐使用 <a href="https://www.npmjs.com/package/data-urls">data-urls</a>。
5
5
  *
6
- * @static
7
6
  * @alias module:Processor.setDataURLPrefix
8
7
  * @since 4.1.0
9
8
  * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/URI/Schemes/data | Data URLs}
package/types/strlen.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 获取字符长度。中文汉字占2个字符,英文占1个字符,特殊如emoji占4个字符。
3
3
  *
4
- * @static
5
4
  * @alias module:Other.strlen
6
5
  * @since 4.10.0
7
6
  * @param {string} str 字符串
package/types/times.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 精确乘法,支持多个数相乘,乘数默认为 1 。
3
3
  *
4
- * @static
5
4
  * @alias module:Math.times
6
5
  * @since 3.1.0
7
6
  * @param {...(number|string)} nums 相乘的数
@@ -6,7 +6,6 @@ type TransformFieldNames<D extends any, F extends Record<string, any>, C extends
6
6
  /**
7
7
  * 转换字段名,返回一个转换字段后的值,不改变原值。
8
8
  *
9
- * @static
10
9
  * @alias module:Tree.transformFieldNames
11
10
  * @since 4.14.0
12
11
  * @param {Object[]} data 对象数组。如果是树结构数据,需要指定第三个参数 childrenField
@@ -10,7 +10,6 @@ interface TransformObjectValue {
10
10
  *
11
11
  * 例如 antd Form 中的设置表单值时,如果值为空字符串可能需要转为 `undefined` ,才不影响表单的初始值。
12
12
  *
13
- * @static
14
13
  * @alias module:Processor.transformObjectValue
15
14
  * @since 4.23.0
16
15
  * @param {Array | Object} data 要转换值的普通对象或数组
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 树结构转列表数据
3
3
  *
4
- * @static
5
4
  * @alias module:Tree.treeToList
6
5
  * @since 4.14.0
7
6
  * @param {Object[]} tree 树结构数据
@@ -3,7 +3,6 @@ declare const config: {
3
3
  };
4
4
  /**
5
5
  * 设置禁止warning提示
6
- * @static
7
6
  * @alias module:Debug.formatBankCard
8
7
  * @since 3.6.1
9
8
  * @param {boolean} bool 是否禁止warning提示
@@ -1,8 +1,11 @@
1
+ export declare function getFileNameExt(name: string): string;
1
2
  export declare function testExt(name: string | undefined, ext: string): boolean;
2
3
  export type UploadFile = {
3
- uid: string;
4
4
  name: string;
5
5
  type?: string;
6
6
  url?: string;
7
+ fileName?: string;
8
+ uid?: string;
9
+ originFileObj?: File;
7
10
  };
8
11
  export declare function isUploadFile(fileObj: UploadFile): boolean;
@@ -20,7 +20,6 @@ type Options = {
20
20
  /**
21
21
  * 验证密码(数字、大小写字母、特殊字符、非法字符)
22
22
  *
23
- * @static
24
23
  * @alias module:Validator.validatePassword
25
24
  * @since 3.7.0
26
25
  * @see {@link https://baike.baidu.com/item/ASCII#3 | ASCII}
@@ -1,41 +0,0 @@
1
- /**
2
- * Blob 对象 URL 记录。
3
- *
4
- * 便于管理项目中上传文件通过 `URL.createObjectURL` 生成的对象URL。
5
- *
6
- * 特点:
7
- * 1. 避免重复创建,相同的 `Blob` 对象只会生成一个 URL 字符串
8
- * 2. 当清除缓存时,自动释放内存
9
- *
10
- * @class
11
- * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/URL/createObjectURL_static | URL:createObjectURL()}
12
- * @example
13
- * const blobUrl = new BlobUrl();
14
- *
15
- */
16
- declare class BlobUrl {
17
- protected cache: Map<Blob, string>;
18
- constructor();
19
- /**
20
- * 同 `URL.createObjectURL` 方法,创建一个对象 URL 字符串。
21
- *
22
- * 生成时内部会记录一个缓存,相同的 `Blob` 对象最多只会产生一个 URL 字符串。
23
- *
24
- * @param {Blob} obj 用于创建 URL 的 File、Blob 对象。
25
- * @returns 一个包含对象 URL 的字符串,可用于引用指定源 object 的内容。
26
- */
27
- createObjectURL(obj: Blob): string | undefined;
28
- /**
29
- * 同 `URL.revokeObjectURL` 方法,释放对象 URL 。
30
- *
31
- * @param {string} url 通过调用 `createObjectURL()` 方法创建的对象 URL 的字符串。
32
- */
33
- revokeObjectURL(url: string): void;
34
- /**
35
- * 清理缓存。
36
- *
37
- * 迭代调用 `URL.revokeObjectURL` 来释放内存。
38
- */
39
- clear(): void;
40
- }
41
- export default BlobUrl;