util-helpers 4.12.4 → 4.12.7
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/README.md +9 -5
- package/dist/util-helpers.js +225 -363
- 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/bytesToSize.js +5 -11
- package/esm/calculateCursorPosition.js +1 -1
- package/esm/dataURLToBlob.js +1 -1
- package/esm/divide.js +1 -0
- package/esm/formatBankCard.js +4 -8
- package/esm/formatMobile.js +9 -7
- package/esm/formatMoney.js +8 -14
- package/esm/isBankCard.js +6 -11
- package/esm/isBusinessLicense.js +7 -10
- package/esm/isChinese.js +10 -17
- package/esm/isEmail.js +2 -5
- package/esm/isHMCard.js +8 -8
- package/esm/isIPv4.js +4 -11
- package/esm/isIPv6.js +11 -29
- package/esm/isIdCard.js +9 -12
- package/esm/isMobile.js +2 -5
- package/esm/isPassport.js +2 -5
- package/esm/isPassword.js +14 -21
- package/esm/isPostcode.js +2 -5
- package/esm/isPromiseLike.js +4 -8
- package/esm/isQQ.js +2 -5
- package/esm/isSocialCreditCode.js +6 -11
- package/esm/isSwiftCode.js +5 -5
- package/esm/isTWCard.js +7 -4
- package/esm/isTelephone.js +7 -10
- package/esm/isUrl.js +8 -20
- package/esm/isVehicle.js +9 -14
- package/esm/isWX.js +2 -5
- package/esm/minus.js +4 -8
- package/esm/normalizeString.js +2 -0
- package/esm/numberToChinese.js +13 -19
- package/esm/padZero.js +9 -8
- package/esm/parseIdCard.js +8 -17
- package/esm/plus.js +4 -8
- package/esm/randomString.js +2 -0
- package/esm/replaceChar.js +9 -17
- package/esm/round.js +4 -8
- package/esm/safeDate.js +2 -0
- package/esm/setDataURLPrefix.js +2 -0
- package/esm/times.js +4 -8
- package/esm/utils/config.js +1 -1
- package/esm/utils/math.util.js +4 -9
- package/esm/waitTime.js +3 -1
- package/lib/bytesToSize.js +5 -11
- package/lib/calculateCursorPosition.js +1 -1
- package/lib/dataURLToBlob.js +1 -1
- package/lib/divide.js +1 -0
- package/lib/formatBankCard.js +4 -8
- package/lib/formatMobile.js +9 -7
- package/lib/formatMoney.js +8 -14
- package/lib/isBankCard.js +6 -11
- package/lib/isBusinessLicense.js +7 -10
- package/lib/isChinese.js +10 -17
- package/lib/isEmail.js +2 -5
- package/lib/isHMCard.js +8 -8
- package/lib/isIPv4.js +4 -11
- package/lib/isIPv6.js +11 -29
- package/lib/isIdCard.js +9 -12
- package/lib/isMobile.js +2 -5
- package/lib/isPassport.js +2 -5
- package/lib/isPassword.js +14 -21
- package/lib/isPostcode.js +2 -5
- package/lib/isPromiseLike.js +4 -8
- package/lib/isQQ.js +2 -5
- package/lib/isSocialCreditCode.js +6 -11
- package/lib/isSwiftCode.js +5 -5
- package/lib/isTWCard.js +7 -4
- package/lib/isTelephone.js +7 -10
- package/lib/isUrl.js +8 -20
- package/lib/isVehicle.js +9 -14
- package/lib/isWX.js +2 -5
- package/lib/minus.js +4 -8
- package/lib/normalizeString.js +2 -0
- package/lib/numberToChinese.js +13 -19
- package/lib/padZero.js +9 -8
- package/lib/parseIdCard.js +8 -19
- package/lib/plus.js +4 -8
- package/lib/randomString.js +2 -0
- package/lib/replaceChar.js +9 -17
- package/lib/round.js +4 -8
- package/lib/safeDate.js +2 -0
- package/lib/setDataURLPrefix.js +2 -0
- package/lib/times.js +4 -8
- package/lib/utils/config.js +1 -1
- package/lib/utils/math.util.js +4 -9
- package/lib/waitTime.js +3 -1
- package/package.json +1 -1
- package/types/src/bytesToSize.d.ts +4 -10
- package/types/src/dataURLToBlob.d.ts +1 -1
- package/types/src/divide.d.ts +1 -0
- package/types/src/formatBankCard.d.ts +4 -8
- package/types/src/formatMobile.d.ts +9 -7
- package/types/src/formatMoney.d.ts +8 -14
- package/types/src/isBankCard.d.ts +5 -10
- package/types/src/isBusinessLicense.d.ts +6 -9
- package/types/src/isChinese.d.ts +9 -16
- package/types/src/isEmail.d.ts +2 -5
- package/types/src/isHMCard.d.ts +8 -8
- package/types/src/isIPv4.d.ts +4 -11
- package/types/src/isIPv6.d.ts +11 -29
- package/types/src/isIdCard.d.ts +8 -11
- package/types/src/isMobile.d.ts +2 -5
- package/types/src/isPassport.d.ts +2 -5
- package/types/src/isPassword.d.ts +10 -17
- package/types/src/isPostcode.d.ts +2 -5
- package/types/src/isPromiseLike.d.ts +3 -7
- package/types/src/isQQ.d.ts +2 -5
- package/types/src/isSocialCreditCode.d.ts +6 -11
- package/types/src/isSwiftCode.d.ts +5 -5
- package/types/src/isTWCard.d.ts +7 -4
- package/types/src/isTelephone.d.ts +6 -9
- package/types/src/isUrl.d.ts +7 -19
- package/types/src/isVehicle.d.ts +8 -13
- package/types/src/isWX.d.ts +2 -5
- package/types/src/minus.d.ts +3 -7
- package/types/src/normalizeString.d.ts +2 -0
- package/types/src/numberToChinese.d.ts +10 -18
- package/types/src/padZero.d.ts +9 -8
- package/types/src/parseIdCard.d.ts +3 -3
- package/types/src/plus.d.ts +3 -7
- package/types/src/randomString.d.ts +2 -0
- package/types/src/replaceChar.d.ts +9 -17
- package/types/src/round.d.ts +3 -7
- package/types/src/safeDate.d.ts +2 -0
- package/types/src/setDataURLPrefix.d.ts +2 -0
- package/types/src/times.d.ts +3 -7
- package/types/src/waitTime.d.ts +3 -1
package/README.md
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
# util-helpers
|
|
2
2
|
|
|
3
|
-
[![npm][npm]][npm-url] 
|
|
3
|
+
[![npm][npm]][npm-url] [](https://github.com/doly-dev/util-helpers/actions/workflows/ci.yml) [](https://codecov.io/gh/doly-dev/util-helpers)  
|
|
4
4
|
|
|
5
5
|
[util-helpers](https://doly-dev.github.io/util-helpers/index.html) 是一个基于业务场景的工具方法库。
|
|
6
6
|
|
|
7
7
|
## 使用
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### `es` 或 `node` 开发环境
|
|
10
|
+
|
|
11
|
+
安装依赖
|
|
10
12
|
|
|
11
13
|
```shell
|
|
12
14
|
npm install util-helpers
|
|
13
15
|
```
|
|
14
16
|
|
|
17
|
+
或者你使用 `yarn`
|
|
18
|
+
|
|
15
19
|
```shell
|
|
16
20
|
yarn add util-helpers
|
|
17
21
|
```
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
### 浏览器引入
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
如果你的项目使用的是原生方式开发,可以在浏览器中使用 `script` 标签直接引入文件,并使用全局变量 `utilHelpers` 。
|
|
22
26
|
|
|
23
|
-
`npm` 包的 `util-helpers/dist` 目录下提供了 `util-helpers.js` 以及 `util-helpers.min.js`。你也可以通过 [UNPKG](https://unpkg.com/util-helpers@latest/dist/) 下载到本地进行使用。或者直接使用 [UNPKG 线上版本](https://unpkg.com/util-helpers@latest/dist/util-helpers.min.js)<sup> _注意版本_ </sup>。
|
|
27
|
+
`npm` 包的 `util-helpers/dist` 目录下提供了 `UMD` 包 `util-helpers.js` 以及 `util-helpers.min.js`。你也可以通过 [UNPKG](https://unpkg.com/util-helpers@latest/dist/) 下载到本地进行使用。或者直接使用 [UNPKG 线上版本](https://unpkg.com/util-helpers@latest/dist/util-helpers.min.js)<sup> _注意版本_ </sup>。
|
|
24
28
|
|
|
25
29
|
## 示例
|
|
26
30
|
|