util-helpers 4.12.7 → 4.12.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.
Files changed (121) hide show
  1. package/dist/util-helpers.js +2 -1
  2. package/dist/util-helpers.js.map +1 -1
  3. package/dist/util-helpers.min.js +1 -1
  4. package/dist/util-helpers.min.js.map +1 -1
  5. package/esm/utils/config.js +2 -1
  6. package/lib/utils/config.js +2 -1
  7. package/package.json +3 -3
  8. package/types/bytesToSize.d.ts +4 -10
  9. package/types/dataURLToBlob.d.ts +1 -1
  10. package/types/divide.d.ts +9 -8
  11. package/types/formatBankCard.d.ts +4 -8
  12. package/types/formatMobile.d.ts +9 -7
  13. package/types/formatMoney.d.ts +8 -14
  14. package/types/index.d.ts +1 -1
  15. package/types/isBankCard.d.ts +5 -10
  16. package/types/isBusinessLicense.d.ts +6 -9
  17. package/types/isChinese.d.ts +9 -16
  18. package/types/isEmail.d.ts +2 -5
  19. package/types/isHMCard.d.ts +8 -8
  20. package/types/isIPv4.d.ts +4 -11
  21. package/types/isIPv6.d.ts +11 -29
  22. package/types/isIdCard.d.ts +8 -11
  23. package/types/isMobile.d.ts +2 -5
  24. package/types/isPassport.d.ts +2 -5
  25. package/types/isPassword.d.ts +10 -17
  26. package/types/isPostcode.d.ts +2 -5
  27. package/types/isPromiseLike.d.ts +3 -7
  28. package/types/isQQ.d.ts +2 -5
  29. package/types/isSocialCreditCode.d.ts +6 -11
  30. package/types/isSwiftCode.d.ts +5 -5
  31. package/types/isTWCard.d.ts +7 -4
  32. package/types/isTelephone.d.ts +6 -9
  33. package/types/isUrl.d.ts +7 -19
  34. package/types/isVehicle.d.ts +8 -13
  35. package/types/isWX.d.ts +2 -5
  36. package/types/minus.d.ts +4 -8
  37. package/types/normalizeString.d.ts +2 -0
  38. package/types/numberToChinese.d.ts +10 -18
  39. package/types/padZero.d.ts +9 -8
  40. package/types/parseIdCard.d.ts +3 -3
  41. package/types/plus.d.ts +4 -8
  42. package/types/randomString.d.ts +2 -0
  43. package/types/replaceChar.d.ts +9 -17
  44. package/types/round.d.ts +3 -7
  45. package/types/safeDate.d.ts +2 -0
  46. package/types/setDataURLPrefix.d.ts +2 -0
  47. package/types/times.d.ts +4 -8
  48. package/types/utils/config.d.ts +2 -0
  49. package/types/utils/math.util.d.ts +4 -4
  50. package/types/waitTime.d.ts +3 -1
  51. package/types/src/blobToDataURL.d.ts +0 -25
  52. package/types/src/bytesToSize.d.ts +0 -18
  53. package/types/src/calculateCursorPosition.d.ts +0 -26
  54. package/types/src/dataURLToBlob.d.ts +0 -15
  55. package/types/src/divide.d.ts +0 -22
  56. package/types/src/formatBankCard.d.ts +0 -31
  57. package/types/src/formatMobile.d.ts +0 -29
  58. package/types/src/formatMoney.d.ts +0 -44
  59. package/types/src/index.d.ts +0 -45
  60. package/types/src/isBankCard.d.ts +0 -27
  61. package/types/src/isBusinessLicense.d.ts +0 -26
  62. package/types/src/isChinese.d.ts +0 -34
  63. package/types/src/isEmail.d.ts +0 -16
  64. package/types/src/isHMCard.d.ts +0 -24
  65. package/types/src/isIPv4.d.ts +0 -18
  66. package/types/src/isIPv6.d.ts +0 -32
  67. package/types/src/isIdCard.d.ts +0 -31
  68. package/types/src/isMobile.d.ts +0 -16
  69. package/types/src/isPassport.d.ts +0 -18
  70. package/types/src/isPassword.d.ts +0 -39
  71. package/types/src/isPostcode.d.ts +0 -16
  72. package/types/src/isPromiseLike.d.ts +0 -17
  73. package/types/src/isQQ.d.ts +0 -16
  74. package/types/src/isSocialCreditCode.d.ts +0 -26
  75. package/types/src/isSwiftCode.d.ts +0 -22
  76. package/types/src/isTWCard.d.ts +0 -26
  77. package/types/src/isTelephone.d.ts +0 -22
  78. package/types/src/isUrl.d.ts +0 -22
  79. package/types/src/isVehicle.d.ts +0 -24
  80. package/types/src/isWX.d.ts +0 -16
  81. package/types/src/minus.d.ts +0 -17
  82. package/types/src/normalizeString.d.ts +0 -24
  83. package/types/src/numberToChinese.d.ts +0 -49
  84. package/types/src/padZero.d.ts +0 -25
  85. package/types/src/parseIdCard.d.ts +0 -107
  86. package/types/src/plus.d.ts +0 -17
  87. package/types/src/randomString.d.ts +0 -21
  88. package/types/src/replaceChar.d.ts +0 -46
  89. package/types/src/round.d.ts +0 -18
  90. package/types/src/safeDate.d.ts +0 -24
  91. package/types/src/setDataURLPrefix.d.ts +0 -26
  92. package/types/src/strlen.d.ts +0 -20
  93. package/types/src/times.d.ts +0 -17
  94. package/types/src/utils/config.d.ts +0 -13
  95. package/types/src/utils/constants.d.ts +0 -2
  96. package/types/src/utils/convertToString.d.ts +0 -8
  97. package/types/src/utils/devWarn.d.ts +0 -7
  98. package/types/src/utils/math.util.d.ts +0 -63
  99. package/types/src/utils/type/index.d.ts +0 -19
  100. package/types/src/utils/type/isArguments.d.ts +0 -18
  101. package/types/src/utils/type/isArray.d.ts +0 -18
  102. package/types/src/utils/type/isBoolean.d.ts +0 -18
  103. package/types/src/utils/type/isDate.d.ts +0 -18
  104. package/types/src/utils/type/isError.d.ts +0 -18
  105. package/types/src/utils/type/isFunction.d.ts +0 -18
  106. package/types/src/utils/type/isMap.d.ts +0 -18
  107. package/types/src/utils/type/isNaN.d.ts +0 -18
  108. package/types/src/utils/type/isNil.d.ts +0 -11
  109. package/types/src/utils/type/isNull.d.ts +0 -18
  110. package/types/src/utils/type/isNumber.d.ts +0 -27
  111. package/types/src/utils/type/isObject.d.ts +0 -21
  112. package/types/src/utils/type/isRegExp.d.ts +0 -18
  113. package/types/src/utils/type/isSet.d.ts +0 -18
  114. package/types/src/utils/type/isString.d.ts +0 -18
  115. package/types/src/utils/type/isSymbol.d.ts +0 -18
  116. package/types/src/utils/type/isType.d.ts +0 -11
  117. package/types/src/utils/type/isUndefined.d.ts +0 -21
  118. package/types/src/utils/type/isWeakMap.d.ts +0 -18
  119. package/types/src/utils/type/isWeakSet.d.ts +0 -18
  120. package/types/src/validatePassword.d.ts +0 -134
  121. package/types/src/waitTime.d.ts +0 -22
@@ -1,45 +0,0 @@
1
- export { default as isMobile } from "./isMobile";
2
- export { default as isTelephone } from "./isTelephone";
3
- export { default as isPostcode } from "./isPostcode";
4
- export { default as isIdCard } from "./isIdCard";
5
- export { default as isEmail } from "./isEmail";
6
- export { default as isQQ } from "./isQQ";
7
- export { default as isWX } from "./isWX";
8
- export { default as isVehicle } from "./isVehicle";
9
- export { default as isBankCard } from "./isBankCard";
10
- export { default as isSocialCreditCode } from "./isSocialCreditCode";
11
- export { default as isPassword } from "./isPassword";
12
- export { default as isPassport } from "./isPassport";
13
- export { default as isChinese } from "./isChinese";
14
- export { default as isIPv4 } from "./isIPv4";
15
- export { default as isIPv6 } from "./isIPv6";
16
- export { default as isUrl } from "./isUrl";
17
- export { default as isBusinessLicense } from "./isBusinessLicense";
18
- export { default as validatePassword } from "./validatePassword";
19
- export { default as isPromiseLike } from "./isPromiseLike";
20
- export { default as isHMCard } from "./isHMCard";
21
- export { default as isTWCard } from "./isTWCard";
22
- export { default as isSwiftCode } from "./isSwiftCode";
23
- export { default as formatMoney } from "./formatMoney";
24
- export { default as formatBankCard } from "./formatBankCard";
25
- export { default as replaceChar } from "./replaceChar";
26
- export { default as numberToChinese } from "./numberToChinese";
27
- export { default as bytesToSize } from "./bytesToSize";
28
- export { default as parseIdCard } from "./parseIdCard";
29
- export { default as blobToDataURL } from "./blobToDataURL";
30
- export { default as dataURLToBlob } from "./dataURLToBlob";
31
- export { default as setDataURLPrefix } from "./setDataURLPrefix";
32
- export { default as normalizeString } from "./normalizeString";
33
- export { default as safeDate } from "./safeDate";
34
- export { default as formatMobile } from "./formatMobile";
35
- export { default as padZero } from "./padZero";
36
- export { default as plus } from "./plus";
37
- export { default as minus } from "./minus";
38
- export { default as times } from "./times";
39
- export { default as divide } from "./divide";
40
- export { default as round } from "./round";
41
- export { default as waitTime } from "./waitTime";
42
- export { default as calculateCursorPosition } from "./calculateCursorPosition";
43
- export { default as randomString } from "./randomString";
44
- export { default as strlen } from "./strlen";
45
- export { setDisableWarning, version } from "./utils/config";
@@ -1,27 +0,0 @@
1
- export default isBankCard;
2
- /**
3
- * 检测值是否为银行卡号。正常模式(非0开头,10~21位数字)宽松模式(8~30位数字)
4
- *
5
- * @static
6
- * @alias module:Validator.isBankCard
7
- * @see 参考 {@link https://kf.qq.com/faq/170112ABnm6b170112FvquAn.html|常用银行账号位数参考}
8
- * @since 1.1.0
9
- * @param {*} value 要检测的值
10
- * @param {Object} [options] 配置项
11
- * @param {boolean} [options.loose=false] 宽松模式,8~30位数字
12
- * @param {boolean} [options.luhn=false] 使用 Luhn 算法校验校验码
13
- * @returns {boolean} 值是否为银行卡号
14
- * @example
15
- *
16
- * isBankCard('6228480402564890018'); // true
17
- * isBankCard('6228480402564890'); // true
18
- * isBankCard('123456789'); // false
19
- *
20
- * // 宽松模式
21
- * isBankCard('123456789', { loose: true }); // true
22
- *
23
- */
24
- declare function isBankCard(value: any, { loose, luhn }?: {
25
- loose?: boolean | undefined;
26
- luhn?: boolean | undefined;
27
- } | undefined): boolean;
@@ -1,26 +0,0 @@
1
- export default isBusinessLicense;
2
- /**
3
- * 检测值是否为营业执照号,也叫工商注册号。由14位数字本体码和1位数字校验码组成,其中本体码从左至右依次为:6位首次登记机关码、8位顺序码。
4
- *
5
- * @static
6
- * @alias module:Validator.isBusinessLicense
7
- * @see 参考 {@link https://wenku.baidu.com/view/19873704cc1755270722087c.html|GS15—2006 工商行政管理市场主体注册号编制规则}
8
- * @since 3.5.0
9
- * @param {*} value 要检测的值
10
- * @param {Object} [options] 配置项
11
- * @param {boolean} [options.checkCode=true] 是否校验最后一位校验码,如果为false,不校验校验位。
12
- * @returns {boolean} 值是否为营业执照号
13
- * @example
14
- *
15
- * isBusinessLicense('310115600985533'); // true
16
- * isBusinessLicense('310115600985535'); // false
17
- *
18
- * // 不校验验证码,长度和类型还是有校验
19
- * isBusinessLicense('310115600985535', { checkCode: false }); // true
20
- * isBusinessLicense('ac115600985535', { checkCode: false }); // false
21
- * isBusinessLicense('31011560098', { checkCode: false }); // false
22
- *
23
- */
24
- declare function isBusinessLicense(value: any, options?: {
25
- checkCode?: boolean | undefined;
26
- } | undefined): boolean;
@@ -1,34 +0,0 @@
1
- export default isChinese;
2
- /**
3
- * 检测值是否为中文
4
- *
5
- * @static
6
- * @alias module:Validator.isChinese
7
- * @since 1.1.0
8
- * @see 参考 {@link http://www.unicode.org/reports/tr38/#BlockListing|4.4 Listing of Characters Covered by the Unihan Database}
9
- * @param {*} value 要检测的值
10
- * @param {Object} [options] 配置项
11
- * @param {boolean} [options.loose=false] 宽松模式。如果为true,只要包含中文即为true
12
- * @param {boolean} [options.useExtend=false] 使用统一表意文字扩展A-F。注意:如果不支持 `RegExp.prototype.unicode`,扩展字符集将自动不生效,如IE浏览器。
13
- * @returns {boolean} 值是否为中文
14
- * @example
15
- *
16
- * isChinese('林某某'); // true
17
- * isChinese('林A'); // false
18
- *
19
- * // 宽松模式,只要包含中文即为true
20
- * isChinese('林A', { loose: true }); // true
21
- * isChinese('A林A', { loose: true }); // true
22
- *
23
- * // 扩展字符集的字符
24
- * isChinese('𠮷'); // false
25
- *
26
- * // 使用中文扩展字符集,需要浏览器支持 RegExp.prototype.unicode 才生效。
27
- * isChinese('𠮷', { useExtend: true }); // true
28
- * isChinese('𠮷aa', { useExtend: true, loose: true }); // true
29
- *
30
- */
31
- declare function isChinese(value: any, { loose, useExtend }?: {
32
- loose?: boolean | undefined;
33
- useExtend?: boolean | undefined;
34
- } | undefined): boolean;
@@ -1,16 +0,0 @@
1
- export default isEmail;
2
- /**
3
- * 检测值是否为Email
4
- *
5
- * @static
6
- * @alias module:Validator.isEmail
7
- * @since 1.1.0
8
- * @param {*} value 要检测的值
9
- * @returns {boolean} 值是否为Email
10
- * @example
11
- *
12
- * isEmail('1232@qq.com'); // true
13
- * isEmail('123@'); // false
14
- *
15
- */
16
- declare function isEmail(value: any): boolean;
@@ -1,24 +0,0 @@
1
- export default isHMCard;
2
- /**
3
- * 检测值是否为港澳居民来往内地通行证,俗称回乡证或回乡卡。
4
- *
5
- * @static
6
- * @alias module:Validator.isHMCard
7
- * @since 4.0.0
8
- * @see 参考 {@link https://zh.wikipedia.org/wiki/港澳居民来往内地通行证|港澳居民来往内地通行证}
9
- * @param {*} value 要检测的值
10
- * @returns {boolean} 是否为港澳居民来往内地通行证
11
- * @example
12
- * // 第一代 11 位
13
- * isHMCard('h3203117707'); // true
14
- * isHMCard('H3203117707'); // true
15
- * isHMCard('m3203117707'); // true
16
- * isHMCard('M3203117707'); // true
17
- *
18
- * // 第二代 9 位
19
- * isHMCard('h32031177'); // true
20
- * isHMCard('H32031177'); // true
21
- * isHMCard('m32031177'); // true
22
- * isHMCard('M32031177'); // true
23
- */
24
- declare function isHMCard(value: any): boolean;
@@ -1,18 +0,0 @@
1
- export default isIPv4;
2
- /**
3
- * 检测值是否为ipv4
4
- *
5
- * @static
6
- * @alias module:Validator.isIPv4
7
- * @since 1.1.0
8
- * @param {*} value 要检测的值
9
- * @returns {boolean} 值是否为ipv4
10
- * @example
11
- *
12
- * isIPv4('192.168.1.1'); // true
13
- * isIPv4('255.255.255.255'); // true
14
- * isIPv4('256.256.256.256'); // false
15
- * isIPv4('0.0'); // false
16
- *
17
- */
18
- declare function isIPv4(value: any): boolean;
@@ -1,32 +0,0 @@
1
- export default isIPv6;
2
- /**
3
- * 检测值是否为ipv6
4
- *
5
- * @static
6
- * @alias module:Validator.isIPv6
7
- * @since 1.1.0
8
- * @param {*} value 要检测的值
9
- * @returns {boolean} 值是否为ipv6
10
- * @example
11
- *
12
- * // 冒分十六进制表示法
13
- * isIPv6('2001:0DB8:0000:0023:0008:0800:200C:417A'); // true
14
- *
15
- * // 前导0省略
16
- * isIPv6('2001:DB8:0:23:8:800:200C:417A'); // true
17
- * isIPv6('FF01:0:0:0:0:0:0:1101'); // true
18
- *
19
- * // 0位压缩表示法
20
- * isIPv6('FF01::1101'); // true
21
- * isIPv6('::1'); // true
22
- * isIPv6('::'); // true
23
- * isIPv6('0:0:0:0:0:0:0:1'); // true
24
- * isIPv6('0:0:0:0:0:0:0:0'); // true
25
- *
26
- * // 内嵌IPv4地址表示法
27
- * isIPv6('::192.168.1.1'); // true
28
- * isIPv6('::FFFF:192.168.1.1'); // true
29
- * isIPv6('192.168.1.1'); // false
30
- *
31
- */
32
- declare function isIPv6(value: any): boolean;
@@ -1,31 +0,0 @@
1
- export default isIdCard;
2
- /**
3
- * 检测值是否为18位身份证号码。<br/>宽松模式下,支持15位身份证号码
4
- *
5
- * @static
6
- * @alias module:Validator.isIdCard
7
- * @since 1.1.0
8
- * @param {*} value 要检测的值
9
- * @param {Object} [options] 配置项
10
- * @param {boolean} [options.loose=false] 宽松模式,支持15位身份证号码
11
- * @param {boolean} [options.checkCode=true] 是否校验最后一位校验码,仅支持18位身份证号码
12
- * @returns {boolean} 值是否为身份证号
13
- * @example
14
- *
15
- * isIdCard('130701199310302288'); // true
16
- * isIdCard('13070119931030228X'); // false
17
- *
18
- * // 不校验校验码
19
- * isIdCard('13070119931030228X', { checkCode: false }); // true
20
- *
21
- * // 默认不支持15位身份证号码
22
- * isIdCard('320311770706001'); // false
23
- *
24
- * // 宽松模式,支持15位身份证号
25
- * isIdCard('320311770706001', { loose: true }); // true
26
- *
27
- */
28
- declare function isIdCard(value: any, { loose, checkCode }?: {
29
- loose?: boolean | undefined;
30
- checkCode?: boolean | undefined;
31
- } | undefined): boolean;
@@ -1,16 +0,0 @@
1
- export default isMobile;
2
- /**
3
- * 检测值是否为手机号码
4
- *
5
- * @static
6
- * @alias module:Validator.isMobile
7
- * @since 1.1.0
8
- * @param {*} value 要检测的值
9
- * @returns {boolean} 值是否为手机号码
10
- * @example
11
- *
12
- * isMobile('13000000000'); // true
13
- * isMobile('13000'); // false
14
- *
15
- */
16
- declare function isMobile(value: any): boolean;
@@ -1,18 +0,0 @@
1
- export default isPassport;
2
- /**
3
- * 检测值是否为护照号
4
- * 支持普通护照(E*)、外交护照(DE)、公务护照(SE)、公务普通护照(PE)、香港特区护照(K/KJ/H*)、澳门特区护照(MA/MB/M*),注意不区分大小写
5
- *
6
- * @static
7
- * @alias module:Validator.isPassport
8
- * @see 参考 {@link https://zh.wikipedia.org/wiki/中华人民共和国护照#个人资料页|中华人民共和国护照#个人资料页}
9
- * @since 1.1.0
10
- * @param {*} value 要检测的值
11
- * @returns {boolean} 值是否为护照号
12
- * @example
13
- *
14
- * isPassport('E12345678'); // true
15
- * isPassport('abc'); // false
16
- *
17
- */
18
- declare function isPassport(value: any): boolean;
@@ -1,39 +0,0 @@
1
- export default isPassword;
2
- /**
3
- * 检测值是否符合密码强度
4
- * <p><strong>注意:该校验只校验是否存在不同字符(大小写字母、数字、特殊符号),不判断长度。</strong></p>
5
- * <p><i>如果需要更细致的验证,请使用 <a href="#.validatePassword">validatePassword</a></i></p>
6
- *
7
- * @see 参考 {@link https://baike.baidu.com/item/ASCII#3|ASCII}
8
- * @static
9
- * @alias module:Validator.isPassword
10
- * @since 1.1.0
11
- * @requires module:Validator.validatePassword
12
- * @param {*} value 要检测的值
13
- * @param {Object} [options] 配置项
14
- * @param {number} [options.level=2] 密码强度 1-包含一种字符 2-包含两种字符 3-包含三种字符。(大写字母、小写字母、数字、特殊字符)
15
- * @param {boolean} [options.ignoreCase=false] 是否忽略大小写,为 ture 时,大小写字母视为一种字符
16
- * @param {string} [options.special="!@#$%^&*()-=_+[]\|{},./?<>~"] 支持的特殊字符
17
- * @returns {boolean} 值是否符合密码强度
18
- * @example
19
- *
20
- * isPassword('a12345678'); // true
21
- *
22
- * // 3级密码强度
23
- * isPassword('a12345678', {level: 3}); // false
24
- * isPassword('Aa12345678', {level: 3}); // true
25
- *
26
- * // 3级密码强度,大小写字符仅计算1级强度
27
- * isPassword('Aa12345678', {level: 3, ignoreCase: true}); // false
28
- * isPassword('_Aa12345678', {level: 3, ignoreCase: true}); // true
29
- *
30
- * // 仅支持 数字、字母、特殊字符,其他非法字符如中文字符是校验不通过的
31
- * isPassword('_Aa一二三45678', {level: 3, ignoreCase: true}); // false
32
- * isPassword(' _Aa12345678', {level: 3, ignoreCase: true}); // false
33
- *
34
- */
35
- declare function isPassword(value: any, { level, ignoreCase, special }?: {
36
- level?: number | undefined;
37
- ignoreCase?: boolean | undefined;
38
- special?: string | undefined;
39
- } | undefined): boolean;
@@ -1,16 +0,0 @@
1
- export default isPostcode;
2
- /**
3
- * 检测值是否为邮政编码,6位数字
4
- *
5
- * @static
6
- * @alias module:Validator.isPostcode
7
- * @since 1.1.0
8
- * @param {*} value 要检测的值
9
- * @returns {boolean} 值是否为邮政编码
10
- * @example
11
- *
12
- * isPostcode('101111'); // true
13
- * isPostcode('123'); // false
14
- *
15
- */
16
- declare function isPostcode(value: any): boolean;
@@ -1,17 +0,0 @@
1
- export default isPromiseLike;
2
- /**
3
- * 检测值是否类似Promise对象
4
- *
5
- * @static
6
- * @alias module:Validator.isPromiseLike
7
- * @since 3.8.0
8
- * @param {*} obj 要检测的值
9
- * @returns {boolean} 是否类似Promise对象
10
- * @example
11
- *
12
- * isPromiseLike([]); // false
13
- * isPromiseLike({ then: () => { } }); // true
14
- * isPromiseLike(Promise.resolve()); // true
15
- *
16
- */
17
- declare function isPromiseLike(obj: any): boolean;
@@ -1,16 +0,0 @@
1
- export default isQQ;
2
- /**
3
- * 检测值是否为QQ号,非0开头,5至11位数字
4
- *
5
- * @static
6
- * @alias module:Validator.isQQ
7
- * @since 1.1.0
8
- * @param {*} value 要检测的值
9
- * @returns {boolean} 值是否为QQ号
10
- * @example
11
- *
12
- * isQQ('12345'); // true
13
- * isQQ('123'); // false
14
- *
15
- */
16
- declare function isQQ(value: any): boolean;
@@ -1,26 +0,0 @@
1
- export default isSocialCreditCode;
2
- /**
3
- * 检测值是否为统一社会信用代码,也叫三证合一组织代码。由18位数字和大写字母组成,不使用I、O、Z、S、V。
4
- *
5
- * @static
6
- * @alias module:Validator.isSocialCreditCode
7
- * @see 参考 {@link https://zh.wikisource.org/zh-hans/GB_32100-2015_法人和其他组织统一社会信用代码编码规则|GB 32100-2015 法人和其他组织统一社会信用代码编码规则}
8
- * @since 1.1.0
9
- * @param {*} value 要检测的值
10
- * @param {Object} [options] 配置项
11
- * @param {boolean} [options.checkCode=true] 是否校验最后一位校验码,如果为false,不校验校验位。
12
- * @returns {boolean} 值是否为统一社会信用代码
13
- * @example
14
- *
15
- * isSocialCreditCode('91350100M000100Y43'); // true
16
- * isSocialCreditCode('91350100M000100Y4A'); // false
17
- *
18
- * // 不校验校验位,长度和类型还是有校验的
19
- * isSocialCreditCode('91350100M000100Y4A', { checkCode: false }); // true
20
- * isSocialCreditCode('91350100M000100YIO', { checkCode: false }); // false
21
- * isSocialCreditCode('91350100M000100Y', { checkCode: false }); // false
22
- *
23
- */
24
- declare function isSocialCreditCode(value: any, options?: {
25
- checkCode?: boolean | undefined;
26
- } | undefined): boolean;
@@ -1,22 +0,0 @@
1
- export default isSwiftCode;
2
- /**
3
- * 检测值是否为 Swift Code。8位或11位,前6位为大写字母,7-8位为大写字母或数字,9-11位为可选的大写字母或数字。
4
- *
5
- * @static
6
- * @alias module:Validator.isSwiftCode
7
- * @see 参考 {@link https://zh.wikipedia.org/wiki/ISO_9362|ISO 9362}
8
- * @since 4.9.0
9
- * @param {*} value 要检测的值
10
- * @returns {boolean} 值是否为 Swift Code
11
- * @example
12
- *
13
- * isSwiftCode('DEUTDEFF'); // true
14
- * isSwiftCode('deutdeff'); // false
15
- *
16
- * isSwiftCode('BKTWTWTP010'); // true
17
- * isSwiftCode('010BKTWTWTP'); // false
18
- *
19
- * isSwiftCode('ICBKCNBJBJM'); // true
20
- *
21
- */
22
- declare function isSwiftCode(value: any): boolean;
@@ -1,26 +0,0 @@
1
- export default isTWCard;
2
- /**
3
- * 检测值是否为台湾居民来往大陆通行证,俗称台胞证。
4
- *
5
- * @static
6
- * @alias module:Validator.isTWCard
7
- * @since 4.0.0
8
- * @see 参考 {@link https://zh.wikipedia.org/wiki/台湾居民来往大陆通行证|台湾居民来往大陆通行证}
9
- * @param {*} value 要检测的值
10
- * @param {Object} [options] 配置项
11
- * @param {boolean} [options.loose=false] 宽松模式。如果为true,表示支持一次性短期通行证
12
- * @returns {boolean} 是否为台湾居民来往大陆通行证
13
- * @example
14
- *
15
- * isTWCard('12345678'); // true
16
- * isTWCard('07257456'); // true
17
- *
18
- * // 一次性短期
19
- * isTWCard('F290299977'); // false
20
- *
21
- * // 宽松模式,支持一次性短期通行证
22
- * isTWCard('F290299977', { loose: true }); // true
23
- */
24
- declare function isTWCard(value: any, { loose }?: {
25
- loose?: boolean | undefined;
26
- } | undefined): boolean;
@@ -1,22 +0,0 @@
1
- export default isTelephone;
2
- /**
3
- * 检测值是否为固定电话
4
- *
5
- * @static
6
- * @alias module:Validator.isTelephone
7
- * @since 1.1.0
8
- * @param {*} value 要检测的值
9
- * @returns {boolean} 值是否为固定电话
10
- * @example
11
- *
12
- * isTelephone('22033212'); // true
13
- * isTelephone('13000000000'); // false
14
- *
15
- * // 含区号
16
- * isTelephone('021-22033212'); // true
17
- *
18
- * // 含区号和分机号
19
- * isTelephone('021-22033212-123'); // true
20
- *
21
- */
22
- declare function isTelephone(value: any): boolean;
@@ -1,22 +0,0 @@
1
- export default isUrl;
2
- /**
3
- * 检测值是否为url
4
- *
5
- * @static
6
- * @alias module:Validator.isUrl
7
- * @since 3.4.0
8
- * @see 参考 {@link https://zh.wikipedia.org/wiki/统一资源定位符|统一资源定位符}
9
- * @param {*} value 要检测的值
10
- * @returns {boolean} 值是否为url
11
- * @example
12
- *
13
- * isUrl(''); // false
14
- * isUrl('8.8.8.8'); // false
15
- * isUrl('example.com'); // true
16
- * isUrl('http://example.com'); // true
17
- * isUrl('https://example.com:8080'); // true
18
- * isUrl('http://www.example.com/test/123'); // true
19
- * isUrl('http://www.example.com/test/123?foo=bar'); // true
20
- *
21
- */
22
- declare function isUrl(value: any): boolean;
@@ -1,24 +0,0 @@
1
- export default isVehicle;
2
- /**
3
- * 检测值是否为车牌号,支持新能源和非新能源车牌
4
- *
5
- * @static
6
- * @alias module:Validator.isVehicle
7
- * @see 参考 {@link https://baike.baidu.com/item/车牌号|车牌号}
8
- * @since 1.1.0
9
- * @param {*} value 要检测的值
10
- * @returns {boolean} 值是否为车牌号
11
- * @example
12
- *
13
- * isVehicle('京L12345'); // true
14
- * isVehicle('京L1234学'); // true
15
- * isVehicle('BL1234警'); // true
16
- *
17
- * // 新能源车牌
18
- * isVehicle('粤BD12345'); // true
19
- * isVehicle('粤BF12345'); // true
20
- * isVehicle('粤B12345D'); // true
21
- * isVehicle('粤B12345F'); // true
22
- *
23
- */
24
- declare function isVehicle(value: any): boolean;
@@ -1,16 +0,0 @@
1
- export default isWX;
2
- /**
3
- * 检测值是否为微信号
4
- *
5
- * @static
6
- * @alias module:Validator.isWX
7
- * @since 1.1.0
8
- * @param {*} value 要检测的值
9
- * @returns {boolean} 值是否为微信号
10
- * @example
11
- *
12
- * isWX('a12345'); // true
13
- * isWX('123'); // false
14
- *
15
- */
16
- declare function isWX(value: any): boolean;
@@ -1,17 +0,0 @@
1
- export default minus;
2
- /**
3
- * 精确减法,支持多个数相减,减数默认为 0 。
4
- *
5
- * @static
6
- * @alias module:Math.minus
7
- * @since 3.1.0
8
- * @param {...number|string} nums 相减的数
9
- * @returns {number} 差
10
- * @example
11
- *
12
- * minus(1, 0.9); // 0.1
13
- * minus(1, 0.9, 0.02); // 0.08
14
- * minus(1, 0.9, 0.02, 0.08); // 0
15
- *
16
- */
17
- declare function minus(...nums: (number | string)[]): number;
@@ -1,24 +0,0 @@
1
- export default normalizeString;
2
- /**
3
- * 规整化字符串。如果值为 undefined 或 null 将转为空字符串,如果值不是字符串类型将转为字符串。
4
- *
5
- * @static
6
- * @alias module:Processor.normalizeString
7
- * @see 参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String#string_instances|String}
8
- * @since 4.3.0
9
- * @param {*} value 待处理的值
10
- * @returns {string} 规整化的值
11
- * @example
12
- *
13
- * normalizeString(); // ''
14
- * normalizeString(undefined); // ''
15
- * normalizeString(void 0); // ''
16
- * normalizeString(null); // ''
17
- *
18
- * normalizeString(true); // 'true'
19
- * normalizeString(NaN); // 'NaN'
20
- * normalizeString(1); // '1'
21
- * normalizeString('a'); // 'a'
22
- *
23
- */
24
- declare function normalizeString(value: any): string;
@@ -1,49 +0,0 @@
1
- export default numberToChinese;
2
- /**
3
- * 数字转中文数字
4
- * 不在安全数字 -9007199254740991~9007199254740991 内,处理会有异常
5
- *
6
- * @static
7
- * @alias module:Processor.numberToChinese
8
- * @since 1.2.0
9
- * @param {number} num 数字
10
- * @param {Object} [options] 配置项
11
- * @param {boolean} [options.big5=false] 繁体
12
- * @param {boolean} [options.unit=true] 计数单位
13
- * @param {string} [options.decimal="点"] 中文小数点,繁体字为點
14
- * @param {string} [options.zero="零"] 设置0。常用配置 〇
15
- * @param {string} [options.negative="负"] 负数前面的字
16
- * @param {Object} [options.unitConfig] 节点单位配置
17
- * @param {string} [options.unitConfig.w="万"] 设置计数单位万。常用配置 萬
18
- * @param {string} [options.unitConfig.y="亿"] 设置计数单位亿。常用配置 億
19
- * @returns {string} 中文数字
20
- * @example
21
- *
22
- * numberToChinese(100); // 一百
23
- * numberToChinese(100.3); // 一百点三
24
- * numberToChinese(1234567890); // 一十二亿三千四百五十六万七千八百九十
25
- * numberToChinese(1234567890.11); // 一十二亿三千四百五十六万七千八百九十点一一
26
- *
27
- * // 繁体
28
- * numberToChinese(100, {big5: true}); // 壹佰
29
- * numberToChinese(100.3, {big5: true}); // 壹佰點叁
30
- * numberToChinese(1234567890.11, {big5: true}); // 壹拾贰亿叁仟肆佰伍拾陆万柒仟捌佰玖拾點壹壹
31
- *
32
- * // 不带计数单位
33
- * numberToChinese(1990, {unit: false}); // 一九九零
34
- *
35
- * // 不带计数单位,修改0
36
- * numberToChinese(1990, {unit: false, zero:'〇'}); // 一九九〇
37
- *
38
- */
39
- declare function numberToChinese(num: number, { big5, unit, decimal, zero, negative, unitConfig }?: {
40
- big5?: boolean | undefined;
41
- unit?: boolean | undefined;
42
- decimal?: string | undefined;
43
- zero?: string | undefined;
44
- negative?: string | undefined;
45
- unitConfig?: {
46
- w?: string | undefined;
47
- y?: string | undefined;
48
- } | undefined;
49
- } | undefined): string;