util-helpers 4.16.2 → 4.17.0
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 +1542 -4040
- 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/validatePassword.js
CHANGED
|
@@ -1,270 +1,113 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var devWarn = require('./utils/devWarn.js');
|
|
2
4
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _devWarn = _interopRequireDefault(require("./utils/devWarn"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
5
|
var regNumber = /[\d]/;
|
|
10
6
|
var regLowerCaseLetter = /[a-z]/;
|
|
11
7
|
var regUpperCaseLetter = /[A-Z]/;
|
|
12
8
|
var regAllNumberAndLetter = /[\d|a-z]/gi;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 是否包含数字
|
|
16
|
-
*
|
|
17
|
-
* @private
|
|
18
|
-
* @param {string} val 检查的值
|
|
19
|
-
* @returns {boolean} 是否包含数字
|
|
20
|
-
*/
|
|
21
9
|
function hasNumber(val) {
|
|
22
|
-
|
|
10
|
+
return regNumber.test(val);
|
|
23
11
|
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 是否包含小写字母
|
|
27
|
-
*
|
|
28
|
-
* @private
|
|
29
|
-
* @param {string} val 检测的值
|
|
30
|
-
* @returns {boolean} 是否包含小写字母
|
|
31
|
-
*/
|
|
32
12
|
function hasLowerCaseLetter(val) {
|
|
33
|
-
|
|
13
|
+
return regLowerCaseLetter.test(val);
|
|
34
14
|
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* 是否包含大写字母
|
|
38
|
-
*
|
|
39
|
-
* @private
|
|
40
|
-
* @param {string} val 检测的值
|
|
41
|
-
* @returns {boolean} 是否包含大写字母
|
|
42
|
-
*/
|
|
43
15
|
function hasUpperCaseLetter(val) {
|
|
44
|
-
|
|
16
|
+
return regUpperCaseLetter.test(val);
|
|
45
17
|
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* 是否为十六进制
|
|
49
|
-
*
|
|
50
|
-
* @private
|
|
51
|
-
* @param {string} val 检测的值
|
|
52
|
-
* @returns {boolean} 是否为十六进制
|
|
53
|
-
*/
|
|
54
18
|
function hasHex(val) {
|
|
55
|
-
|
|
19
|
+
return val.indexOf('\\x') > -1 || val.indexOf('\\u') > -1;
|
|
56
20
|
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 是否包含特殊字符
|
|
60
|
-
*
|
|
61
|
-
* @private
|
|
62
|
-
* @param {string} val 检测的值
|
|
63
|
-
* @param {string} chars 特殊字符
|
|
64
|
-
* @returns {boolean} 是否包含特殊字符
|
|
65
|
-
*/
|
|
66
21
|
function hasSpecialCharacter(val, chars) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
var ret = false;
|
|
79
|
-
specialChars.split('').some(function (charItem) {
|
|
80
|
-
if (chars.indexOf(charItem) > -1) {
|
|
81
|
-
ret = true;
|
|
22
|
+
if (!chars || !val) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
var specialChars = val.replace(regAllNumberAndLetter, '');
|
|
26
|
+
if (!specialChars) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
var regChars = hasHex(chars) ? new RegExp("[".concat(chars, "]")) : null;
|
|
30
|
+
if (regChars) {
|
|
31
|
+
return regChars.test(specialChars);
|
|
82
32
|
}
|
|
33
|
+
var ret = false;
|
|
34
|
+
specialChars.split('').some(function (charItem) {
|
|
35
|
+
if (chars.indexOf(charItem) > -1) {
|
|
36
|
+
ret = true;
|
|
37
|
+
}
|
|
38
|
+
return ret;
|
|
39
|
+
});
|
|
83
40
|
return ret;
|
|
84
|
-
});
|
|
85
|
-
return ret;
|
|
86
41
|
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* 是否包含非法字符
|
|
90
|
-
*
|
|
91
|
-
* @private
|
|
92
|
-
* @param {string} val 检测的值
|
|
93
|
-
* @param {string} chars 特殊字符
|
|
94
|
-
* @returns {boolean} 是否包含非法字符
|
|
95
|
-
*/
|
|
96
42
|
function hasUnallowableCharacter(val, chars) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
} else if (!chars) {
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
var regChars = hasHex(chars) ? new RegExp("[^".concat(chars, "]")) : null;
|
|
107
|
-
if (regChars) {
|
|
108
|
-
return regChars.test(specialChars);
|
|
109
|
-
}
|
|
110
|
-
var ret = false;
|
|
111
|
-
specialChars.split('').some(function (charItem) {
|
|
112
|
-
if (chars.indexOf(charItem) === -1) {
|
|
113
|
-
ret = true;
|
|
43
|
+
if (!val) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
var specialChars = val.replace(regAllNumberAndLetter, '');
|
|
47
|
+
if (!specialChars) {
|
|
48
|
+
return false;
|
|
114
49
|
}
|
|
50
|
+
else if (!chars) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
var regChars = hasHex(chars) ? new RegExp("[^".concat(chars, "]")) : null;
|
|
54
|
+
if (regChars) {
|
|
55
|
+
return regChars.test(specialChars);
|
|
56
|
+
}
|
|
57
|
+
var ret = false;
|
|
58
|
+
specialChars.split('').some(function (charItem) {
|
|
59
|
+
if (chars.indexOf(charItem) === -1) {
|
|
60
|
+
ret = true;
|
|
61
|
+
}
|
|
62
|
+
return ret;
|
|
63
|
+
});
|
|
115
64
|
return ret;
|
|
116
|
-
});
|
|
117
|
-
return ret;
|
|
118
65
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
* @property {boolean} unallowableCharacter - 包含非法字符
|
|
127
|
-
*/
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* @typedef {Object} ValidatePasswordReturn - 验证结果
|
|
131
|
-
* @property {boolean} validated - 验证结果,根据密码强度、是否包含非法字符得出
|
|
132
|
-
* @property {number} level - 强度级别,包含数字/大小写字母/特殊字符
|
|
133
|
-
* @property {PasswordContaines} containes - 包含内容
|
|
134
|
-
*/
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* 验证密码(数字、大小写字母、特殊字符、非法字符)
|
|
138
|
-
*
|
|
139
|
-
* @static
|
|
140
|
-
* @alias module:Validator.validatePassword
|
|
141
|
-
* @since 3.7.0
|
|
142
|
-
* @see {@link https://baike.baidu.com/item/ASCII#3|ASCII}
|
|
143
|
-
* @param {string} value 要检测的值
|
|
144
|
-
* @param {Object} [options] 配置项
|
|
145
|
-
* @param {number} [options.level=2] 密码强度 1-包含一种字符 2-包含两种字符 3-包含三种字符。(大写字母、小写字母、数字、特殊字符)
|
|
146
|
-
* @param {boolean} [options.ignoreCase=false] 是否忽略大小写,为 ture 时,大小写字母视为一种字符
|
|
147
|
-
* @param {string} [options.special="!@#$%^&*()-=_+[]\|{},./?<>~"] 支持的特殊字符
|
|
148
|
-
* @returns {ValidatePasswordReturn} 验证结果
|
|
149
|
-
* @example
|
|
150
|
-
*
|
|
151
|
-
* validatePassword('a12345678');
|
|
152
|
-
* // =>
|
|
153
|
-
* {
|
|
154
|
-
* validated: true, // 验证结果,根据密码强度、是否包含非法字符得出
|
|
155
|
-
* level: 2, // 强度级别
|
|
156
|
-
* containes: {
|
|
157
|
-
* number: true, // 包含数字
|
|
158
|
-
* lowerCaseLetter: true, // 包含小写字母
|
|
159
|
-
* upperCaseLetter: false, // 包含大写字母
|
|
160
|
-
* specialCharacter: false, // 包含特殊字符
|
|
161
|
-
* unallowableCharacter: false // 包含非法字符
|
|
162
|
-
* }
|
|
163
|
-
* }
|
|
164
|
-
*
|
|
165
|
-
* validatePassword('a12345678', { level: 3 });
|
|
166
|
-
* // =>
|
|
167
|
-
* {
|
|
168
|
-
* validated: false,
|
|
169
|
-
* level: 2,
|
|
170
|
-
* containes: {
|
|
171
|
-
* number: true,
|
|
172
|
-
* lowerCaseLetter: true,
|
|
173
|
-
* upperCaseLetter: false,
|
|
174
|
-
* specialCharacter: false,
|
|
175
|
-
* unallowableCharacter: false
|
|
176
|
-
* }
|
|
177
|
-
* }
|
|
178
|
-
*
|
|
179
|
-
* validatePassword('_Aa一二三45678', { level: 3, ignoreCase: true });
|
|
180
|
-
* // =>
|
|
181
|
-
* {
|
|
182
|
-
* validated: false,
|
|
183
|
-
* level: 3,
|
|
184
|
-
* containes: {
|
|
185
|
-
* number: true,
|
|
186
|
-
* lowerCaseLetter: true,
|
|
187
|
-
* upperCaseLetter: true,
|
|
188
|
-
* specialCharacter: true,
|
|
189
|
-
* unallowableCharacter: true
|
|
190
|
-
* }
|
|
191
|
-
* }
|
|
192
|
-
*
|
|
193
|
-
* // 自定义特殊字符
|
|
194
|
-
* validatePassword('_Aa一二三45678', { level: 3, ignoreCase: true, special: '_一二三' });
|
|
195
|
-
* // =>
|
|
196
|
-
* {
|
|
197
|
-
* validated: true,
|
|
198
|
-
* level: 3,
|
|
199
|
-
* containes: {
|
|
200
|
-
* number: true,
|
|
201
|
-
* lowerCaseLetter: true,
|
|
202
|
-
* upperCaseLetter: true,
|
|
203
|
-
* specialCharacter: true,
|
|
204
|
-
* unallowableCharacter: false
|
|
205
|
-
* }
|
|
206
|
-
* }
|
|
207
|
-
*/
|
|
208
|
-
function validatePassword(value) {
|
|
209
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
210
|
-
var _options$level = options.level,
|
|
211
|
-
level = _options$level === void 0 ? 2 : _options$level,
|
|
212
|
-
_options$ignoreCase = options.ignoreCase,
|
|
213
|
-
ignoreCase = _options$ignoreCase === void 0 ? false : _options$ignoreCase,
|
|
214
|
-
_options$special = options.special,
|
|
215
|
-
special = _options$special === void 0 ? '\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E' : _options$special;
|
|
216
|
-
var valStr = value;
|
|
217
|
-
if (typeof value !== 'string') {
|
|
218
|
-
(0, _devWarn["default"])("[validatePassword] value must be a string.");
|
|
219
|
-
valStr = '';
|
|
220
|
-
}
|
|
221
|
-
var currentLevel = 0;
|
|
222
|
-
|
|
223
|
-
// 包含数字
|
|
224
|
-
var containesNumber = hasNumber(valStr);
|
|
225
|
-
// 包含小写字母
|
|
226
|
-
var containesLowerCaseLetter = hasLowerCaseLetter(valStr);
|
|
227
|
-
// 包含大写字母
|
|
228
|
-
var containesUpperCaseLetter = hasUpperCaseLetter(valStr);
|
|
229
|
-
// 包含特殊字符
|
|
230
|
-
var containesSpecialCharacter = hasSpecialCharacter(valStr, special);
|
|
231
|
-
// 包含非法字符,即含有非数字字母特殊字符以外的其他字符
|
|
232
|
-
var containesUnallowableCharacter = hasUnallowableCharacter(valStr, special);
|
|
233
|
-
if (containesNumber) {
|
|
234
|
-
currentLevel += 1;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// 不区分大小写
|
|
238
|
-
if (ignoreCase) {
|
|
239
|
-
if (containesLowerCaseLetter || containesUpperCaseLetter) {
|
|
240
|
-
currentLevel += 1;
|
|
66
|
+
function validatePassword(value, options) {
|
|
67
|
+
if (options === void 0) { options = {}; }
|
|
68
|
+
var _a = options.level, level = _a === void 0 ? 2 : _a, _b = options.ignoreCase, ignoreCase = _b === void 0 ? false : _b, _c = options.special, special = _c === void 0 ? '\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E' : _c;
|
|
69
|
+
var valStr = value;
|
|
70
|
+
if (typeof value !== 'string') {
|
|
71
|
+
devWarn("[validatePassword] value must be a string.");
|
|
72
|
+
valStr = '';
|
|
241
73
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
74
|
+
var currentLevel = 0;
|
|
75
|
+
var containesNumber = hasNumber(valStr);
|
|
76
|
+
var containesLowerCaseLetter = hasLowerCaseLetter(valStr);
|
|
77
|
+
var containesUpperCaseLetter = hasUpperCaseLetter(valStr);
|
|
78
|
+
var containesSpecialCharacter = hasSpecialCharacter(valStr, special);
|
|
79
|
+
var containesUnallowableCharacter = hasUnallowableCharacter(valStr, special);
|
|
80
|
+
if (containesNumber) {
|
|
81
|
+
currentLevel += 1;
|
|
246
82
|
}
|
|
247
|
-
if (
|
|
248
|
-
|
|
83
|
+
if (ignoreCase) {
|
|
84
|
+
if (containesLowerCaseLetter || containesUpperCaseLetter) {
|
|
85
|
+
currentLevel += 1;
|
|
86
|
+
}
|
|
249
87
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
return {
|
|
258
|
-
validated: validated,
|
|
259
|
-
level: currentLevel,
|
|
260
|
-
containes: {
|
|
261
|
-
number: containesNumber,
|
|
262
|
-
lowerCaseLetter: containesLowerCaseLetter,
|
|
263
|
-
upperCaseLetter: containesUpperCaseLetter,
|
|
264
|
-
specialCharacter: containesSpecialCharacter,
|
|
265
|
-
unallowableCharacter: containesUnallowableCharacter
|
|
88
|
+
else {
|
|
89
|
+
if (containesLowerCaseLetter) {
|
|
90
|
+
currentLevel += 1;
|
|
91
|
+
}
|
|
92
|
+
if (containesUpperCaseLetter) {
|
|
93
|
+
currentLevel += 1;
|
|
94
|
+
}
|
|
266
95
|
}
|
|
267
|
-
|
|
96
|
+
if (containesSpecialCharacter) {
|
|
97
|
+
currentLevel += 1;
|
|
98
|
+
}
|
|
99
|
+
var validated = currentLevel >= level && !containesUnallowableCharacter;
|
|
100
|
+
return {
|
|
101
|
+
validated: validated,
|
|
102
|
+
level: currentLevel,
|
|
103
|
+
containes: {
|
|
104
|
+
number: containesNumber,
|
|
105
|
+
lowerCaseLetter: containesLowerCaseLetter,
|
|
106
|
+
upperCaseLetter: containesUpperCaseLetter,
|
|
107
|
+
specialCharacter: containesSpecialCharacter,
|
|
108
|
+
unallowableCharacter: containesUnallowableCharacter
|
|
109
|
+
}
|
|
110
|
+
};
|
|
268
111
|
}
|
|
269
|
-
|
|
270
|
-
exports
|
|
112
|
+
|
|
113
|
+
module.exports = validatePassword;
|
package/lib/waitTime.js
CHANGED
|
@@ -1,34 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* 等待时间返回 Promise 。常用于异步方法中延时。
|
|
9
|
-
*
|
|
10
|
-
* @static
|
|
11
|
-
* @alias module:Other.waitTime
|
|
12
|
-
* @since 4.2.0
|
|
13
|
-
* @param {number} [time=1000] 延时时间,单位毫秒
|
|
14
|
-
* @returns {Promise<void>}
|
|
15
|
-
* @example
|
|
16
|
-
*
|
|
17
|
-
* const test = async ()=>{
|
|
18
|
-
* await waitTime();
|
|
19
|
-
* // do something
|
|
20
|
-
* }
|
|
21
|
-
*
|
|
22
|
-
* waitTime(500).then(()=>{
|
|
23
|
-
* // do something
|
|
24
|
-
* });
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
function waitTime() {
|
|
28
|
-
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000;
|
|
29
|
-
return new Promise(function (resolve) {
|
|
30
|
-
setTimeout(resolve, time);
|
|
31
|
-
});
|
|
3
|
+
function waitTime(time) {
|
|
4
|
+
if (time === void 0) { time = 1000; }
|
|
5
|
+
return new Promise(function (resolve) {
|
|
6
|
+
setTimeout(resolve, time);
|
|
7
|
+
});
|
|
32
8
|
}
|
|
33
|
-
|
|
34
|
-
exports
|
|
9
|
+
|
|
10
|
+
module.exports = waitTime;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "util-helpers",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.17.0",
|
|
4
4
|
"description": "一个基于业务场景的工具方法库",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -15,22 +15,19 @@
|
|
|
15
15
|
"test:type": "jest --verbose test/type",
|
|
16
16
|
"test:validator": "jest --verbose test/validator",
|
|
17
17
|
"test:processor": "jest --verbose test/processor",
|
|
18
|
-
"build": "npm run build:
|
|
19
|
-
"build:
|
|
20
|
-
"build:
|
|
21
|
-
"build:
|
|
18
|
+
"build": "npm run build:module && npm run build:dist && npm run build:types",
|
|
19
|
+
"build:module": "rm -rf esm && rm -rf lib && rollup -c rollup.module.config.mjs",
|
|
20
|
+
"build:dist": "rm -rf dist && rollup -c rollup.umd.config.mjs",
|
|
21
|
+
"build:types": "rm -rf types && tsc -d --outDir types --emitDeclarationOnly",
|
|
22
22
|
"build:doc": "npm run doc",
|
|
23
|
-
"doc": "rm -rf docs && jsdoc -c conf.json",
|
|
23
|
+
"doc": "rm -rf docs && rm -rf docs-src && tsc --outDir docs-src && jsdoc -c conf.json && rm -rf docs-src",
|
|
24
24
|
"doc:open": "open ./docs/index.html",
|
|
25
|
-
"prettier": "prettier --write 'src/**/*.
|
|
26
|
-
"lint-staged": "lint-staged",
|
|
27
|
-
"lint-staged:js": "eslint --ext .js",
|
|
25
|
+
"prettier": "prettier --write 'src/**/*.ts' && prettier --write 'test/**/*.ts'",
|
|
28
26
|
"precommit": "lint-staged",
|
|
29
|
-
"lint": "eslint src --ext .
|
|
30
|
-
"lint:fix": "eslint src --ext .
|
|
27
|
+
"lint": "eslint src --ext .ts",
|
|
28
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
31
29
|
"commit": "cz",
|
|
32
|
-
"prepublishOnly": "npm test && npm run build"
|
|
33
|
-
"types": "rm -rf types && tsc"
|
|
30
|
+
"prepublishOnly": "npm test && npm run build"
|
|
34
31
|
},
|
|
35
32
|
"repository": {
|
|
36
33
|
"type": "git",
|
|
@@ -57,38 +54,37 @@
|
|
|
57
54
|
},
|
|
58
55
|
"homepage": "https://doly-dev.github.io/util-helpers/index.html",
|
|
59
56
|
"devDependencies": {
|
|
60
|
-
"@babel/cli": "^7.21.0",
|
|
61
57
|
"@babel/core": "^7.21.4",
|
|
62
|
-
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
|
|
63
|
-
"@babel/plugin-transform-runtime": "^7.21.4",
|
|
64
58
|
"@babel/preset-env": "^7.21.4",
|
|
65
59
|
"@babel/preset-typescript": "^7.21.4",
|
|
66
60
|
"@commitlint/cli": "^11.0.0",
|
|
67
61
|
"@commitlint/config-conventional": "^11.0.0",
|
|
68
|
-
"@rollup/plugin-
|
|
69
|
-
"@rollup/plugin-
|
|
70
|
-
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
62
|
+
"@rollup/plugin-commonjs": "^24.1.0",
|
|
63
|
+
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
71
64
|
"@rollup/plugin-replace": "^5.0.2",
|
|
65
|
+
"@rollup/plugin-terser": "^0.4.1",
|
|
66
|
+
"@rollup/plugin-typescript": "^11.1.0",
|
|
72
67
|
"@types/jest": "^29.5.1",
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^5.59.1",
|
|
69
|
+
"@typescript-eslint/parser": "^5.59.1",
|
|
73
70
|
"babel-jest": "^29.5.0",
|
|
74
71
|
"babel-plugin-minify-replace": "^0.5.0",
|
|
75
72
|
"cross-env": "^7.0.3",
|
|
76
73
|
"cz-conventional-changelog": "^3.3.0",
|
|
77
74
|
"docdash": "^1.2.0",
|
|
78
|
-
"eslint": "^
|
|
75
|
+
"eslint": "^8.39.0",
|
|
79
76
|
"husky": "^4.3.6",
|
|
80
77
|
"jest": "^29.5.0",
|
|
81
78
|
"jest-environment-jsdom": "^29.5.0",
|
|
82
79
|
"jsdoc": "^3.6.3",
|
|
83
80
|
"lint-staged": "^11.1.2",
|
|
84
81
|
"prettier": "^2.8.8",
|
|
85
|
-
"rollup": "^
|
|
86
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
82
|
+
"rollup": "^3.21.0",
|
|
87
83
|
"typescript": "^5.0.4"
|
|
88
84
|
},
|
|
89
85
|
"lint-staged": {
|
|
90
|
-
"**/*.
|
|
91
|
-
"**/*.{js,md}": "prettier --write"
|
|
86
|
+
"**/*.ts": "eslint",
|
|
87
|
+
"**/*.{js,ts,md}": "prettier --write"
|
|
92
88
|
},
|
|
93
89
|
"husky": {
|
|
94
90
|
"hooks": {
|
|
@@ -101,6 +97,6 @@
|
|
|
101
97
|
}
|
|
102
98
|
},
|
|
103
99
|
"dependencies": {
|
|
104
|
-
"
|
|
100
|
+
"tslib": "^2.5.0"
|
|
105
101
|
}
|
|
106
102
|
}
|
package/types/ajax.d.ts
CHANGED
|
@@ -1,101 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
headers?: {
|
|
22
|
-
[x: string]: string;
|
|
23
|
-
} | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* 响应类型
|
|
26
|
-
*/
|
|
27
|
-
responseType?: XMLHttpRequestResponseType | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* 请求超时的毫秒数
|
|
30
|
-
*/
|
|
31
|
-
timeout?: number | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* 跨域请求时是否需要使用凭证
|
|
34
|
-
*/
|
|
35
|
-
withCredentials?: boolean | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* 是否异步执行操作
|
|
38
|
-
*/
|
|
39
|
-
async?: boolean | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* 用户名,用于认证用途
|
|
42
|
-
*/
|
|
43
|
-
user?: string | null | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* 密码,用于认证用途
|
|
46
|
-
*/
|
|
47
|
-
password?: string | null | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* 接收到响应数据时触发
|
|
50
|
-
*/
|
|
51
|
-
onLoadStart?: ((this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any) | null | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* 请求接收到更多数据时,周期性地触发
|
|
54
|
-
*/
|
|
55
|
-
onProgress?: ((this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any) | null | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* 当 request 被停止时触发,例如当程序调用 XMLHttpRequest.abort() 时
|
|
58
|
-
*/
|
|
59
|
-
onAbort?: ((this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any) | null | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* 在预设时间内没有接收到响应时触发
|
|
62
|
-
*/
|
|
63
|
-
onTimeout?: ((this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any) | null | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* 当 request 遭遇错误时触发
|
|
66
|
-
*/
|
|
67
|
-
onError?: ((this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any) | null | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* 请求成功完成时触发
|
|
70
|
-
*/
|
|
71
|
-
onLoad?: ((this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any) | null | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* 请求结束时触发,无论请求成功 (load) 还是失败 (abort 或 error)
|
|
74
|
-
*/
|
|
75
|
-
onLoadEnd?: ((this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any) | null | undefined;
|
|
1
|
+
type XMLHttpRequestListener = XMLHttpRequest['onloadstart'];
|
|
2
|
+
type AjaxOptions = {
|
|
3
|
+
method?: string;
|
|
4
|
+
async?: boolean;
|
|
5
|
+
user?: string | null;
|
|
6
|
+
password?: string | null;
|
|
7
|
+
data?: Parameters<XMLHttpRequest['send']>[0];
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
responseType?: XMLHttpRequestResponseType;
|
|
10
|
+
timeout?: number;
|
|
11
|
+
withCredentials?: boolean;
|
|
12
|
+
onReadyStateChange?: XMLHttpRequest['onreadystatechange'];
|
|
13
|
+
onLoadStart?: XMLHttpRequestListener;
|
|
14
|
+
onProgress?: XMLHttpRequestListener;
|
|
15
|
+
onAbort?: XMLHttpRequestListener;
|
|
16
|
+
onTimeout?: XMLHttpRequestListener;
|
|
17
|
+
onError?: XMLHttpRequestListener;
|
|
18
|
+
onLoad?: XMLHttpRequestListener;
|
|
19
|
+
onLoadEnd?: XMLHttpRequestListener;
|
|
76
20
|
};
|
|
77
21
|
/**
|
|
78
|
-
* @
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/XMLHttpRequest|XMLHttpRequest}
|
|
82
|
-
* @typedef {Object} AjaxOptions ajax配置项
|
|
22
|
+
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/XMLHttpRequest | XMLHttpRequest}
|
|
23
|
+
* @typedef {Object} AjaxOptions ajax 配置项
|
|
83
24
|
* @property {string} [method="get"] 创建请求时使用的方法
|
|
84
|
-
* @property {Document | XMLHttpRequestBodyInit | null} [data=null] 请求体被发送的数据
|
|
85
|
-
* @property {Object.<string, string>} [headers] 自定义请求头
|
|
86
|
-
* @property {XMLHttpRequestResponseType} [responseType] 响应类型
|
|
87
|
-
* @property {number} [timeout] 请求超时的毫秒数
|
|
88
|
-
* @property {boolean} [withCredentials=false] 跨域请求时是否需要使用凭证
|
|
89
25
|
* @property {boolean} [async=true] 是否异步执行操作
|
|
90
26
|
* @property {string|null} [user=null] 用户名,用于认证用途
|
|
91
27
|
* @property {string|null} [password=null] 密码,用于认证用途
|
|
92
|
-
* @property {
|
|
93
|
-
* @property {
|
|
94
|
-
* @property {
|
|
95
|
-
* @property {
|
|
96
|
-
* @property {
|
|
97
|
-
* @property {
|
|
98
|
-
* @property {
|
|
28
|
+
* @property {object} [headers] 自定义请求头
|
|
29
|
+
* @property {string} [responseType] 响应类型
|
|
30
|
+
* @property {number} [timeout] 请求超时的毫秒数
|
|
31
|
+
* @property {boolean} [withCredentials=false] 跨域请求时是否需要使用凭证
|
|
32
|
+
* @property {*} [data=null] 请求体被发送的数据
|
|
33
|
+
* @property {function} [options.onReadyStateChange] 当 readyState 属性发生变化时触发
|
|
34
|
+
* @property {function} [onLoadStart] 接收到响应数据时触发
|
|
35
|
+
* @property {function} [onProgress] 请求接收到更多数据时,周期性地触发
|
|
36
|
+
* @property {function} [onAbort] 当 request 被停止时触发,例如当程序调用 XMLHttpRequest.abort() 时
|
|
37
|
+
* @property {function} [onTimeout] 在预设时间内没有接收到响应时触发
|
|
38
|
+
* @property {function} [onError] 当 request 遭遇错误时触发
|
|
39
|
+
* @property {function} [onLoad] 请求成功完成时触发
|
|
40
|
+
* @property {function} [onLoadEnd] 请求结束时触发,无论请求成功 (load) 还是失败 (abort 或 error)
|
|
99
41
|
*/
|
|
100
42
|
/**
|
|
101
43
|
* 请求<br/><br/>
|
|
@@ -105,10 +47,10 @@ export type AjaxOptions = {
|
|
|
105
47
|
* @static
|
|
106
48
|
* @alias module:Other.ajax
|
|
107
49
|
* @since 4.16.0
|
|
108
|
-
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/XMLHttpRequest|XMLHttpRequest}
|
|
50
|
+
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/XMLHttpRequest | XMLHttpRequest}
|
|
109
51
|
* @param {string} url 地址
|
|
110
52
|
* @param {AjaxOptions} [options] 配置项
|
|
111
|
-
* @returns {Promise<
|
|
53
|
+
* @returns {Promise<object>} XHR 事件对象
|
|
112
54
|
* @example
|
|
113
55
|
* ajax('/somefile').then(res=>{
|
|
114
56
|
* // do something
|
|
@@ -118,4 +60,5 @@ export type AjaxOptions = {
|
|
|
118
60
|
* // do something
|
|
119
61
|
* });
|
|
120
62
|
*/
|
|
121
|
-
declare function ajax(url: string, options?: AjaxOptions
|
|
63
|
+
declare function ajax(url: string, options?: AjaxOptions): Promise<ProgressEvent<EventTarget>>;
|
|
64
|
+
export default ajax;
|
package/types/blobToDataURL.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export default blobToDataURL;
|
|
2
1
|
/**
|
|
3
2
|
* 将 Blob 或 File 对象转成 data:URL 格式的 Base64 字符串<br/><br/>
|
|
4
3
|
*
|
|
@@ -8,7 +7,7 @@ export default blobToDataURL;
|
|
|
8
7
|
* @static
|
|
9
8
|
* @alias module:Processor.blobToDataURL
|
|
10
9
|
* @since 4.1.0
|
|
11
|
-
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/FileReader/readAsDataURL|FileReader.readAsDataURL()}
|
|
10
|
+
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/FileReader/readAsDataURL | FileReader.readAsDataURL()}
|
|
12
11
|
* @deprecated 请使用 `fileReader` 方法
|
|
13
12
|
* @param {Blob} blob Blob 或 File 对象
|
|
14
13
|
* @returns {Promise<string>} data:URL 格式的 Base64 字符串。
|
|
@@ -27,3 +26,4 @@ export default blobToDataURL;
|
|
|
27
26
|
* });
|
|
28
27
|
*/
|
|
29
28
|
declare function blobToDataURL(blob: Blob): Promise<string>;
|
|
29
|
+
export default blobToDataURL;
|