util-helpers 4.0.5 → 4.1.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.
Files changed (48) hide show
  1. package/README.md +4 -50
  2. package/dist/util-helpers.js +204 -65
  3. package/dist/util-helpers.min.js +1 -1
  4. package/dist/util-helpers.min.js.map +1 -1
  5. package/esm/blobToDataURL.js +43 -0
  6. package/esm/dataURLToBlob.js +31 -0
  7. package/esm/divide.js +17 -8
  8. package/esm/formatBankCard.js +1 -1
  9. package/esm/formatMoney.js +7 -5
  10. package/esm/index.js +3 -0
  11. package/esm/isBusinessLicense.js +2 -2
  12. package/esm/isSocialCreditCode.js +2 -2
  13. package/esm/minus.js +17 -8
  14. package/esm/parseIdCard.js +2 -2
  15. package/esm/plus.js +17 -8
  16. package/esm/replaceChar.js +1 -1
  17. package/esm/setDataURLPrefix.js +28 -0
  18. package/esm/times.js +17 -8
  19. package/esm/utils/convertToString.js +2 -11
  20. package/esm/utils/math.util.js +4 -5
  21. package/lib/blobToDataURL.js +51 -0
  22. package/lib/dataURLToBlob.js +39 -0
  23. package/lib/divide.js +29 -8
  24. package/lib/formatBankCard.js +1 -1
  25. package/lib/formatMoney.js +6 -5
  26. package/lib/index.js +24 -0
  27. package/lib/isBusinessLicense.js +2 -2
  28. package/lib/isSocialCreditCode.js +2 -2
  29. package/lib/minus.js +29 -8
  30. package/lib/parseIdCard.js +2 -2
  31. package/lib/plus.js +29 -8
  32. package/lib/replaceChar.js +1 -1
  33. package/lib/setDataURLPrefix.js +36 -0
  34. package/lib/times.js +29 -8
  35. package/lib/utils/convertToString.js +2 -12
  36. package/lib/utils/math.util.js +4 -3
  37. package/package.json +2 -2
  38. package/types/blobToDataURL.d.ts +25 -0
  39. package/types/dataURLToBlob.d.ts +15 -0
  40. package/types/divide.d.ts +2 -4
  41. package/types/index.d.ts +3 -0
  42. package/types/minus.d.ts +2 -4
  43. package/types/parseIdCard.d.ts +15 -2
  44. package/types/plus.d.ts +2 -4
  45. package/types/setDataURLPrefix.d.ts +23 -0
  46. package/types/times.d.ts +2 -4
  47. package/types/utils/convertToString.d.ts +2 -2
  48. package/types/utils/math.util.d.ts +7 -0
package/README.md CHANGED
@@ -87,56 +87,8 @@ formatMoney('1000'); // => 1,000.00
87
87
  - [tinycolor2] - JavaScript 颜色工具,用于 JavaScript 中的颜色处理和转换
88
88
  - [store2] - 丰富了 localStorage 和 sessionStorage 功能(JSON,命名空间,扩展等)
89
89
  - [uuid] - 生成通用唯一识别码(Universally Unique Identifier)
90
-
91
- ## 贡献
92
-
93
- ### commit 格式
94
-
95
- - **格式**
96
-
97
- ```bash
98
- type(scope?): subject
99
- ```
100
-
101
- - **示例**
102
-
103
- ```bash
104
- chore: run tests on travis ci
105
- fix(server): send cors headers
106
- feat(blog): add comment section
107
- ```
108
-
109
- - **type**
110
-
111
- | 值 | 说明 |
112
- | -------- | -------------------------------------------------------------------------------- |
113
- | build | 影响构建系统或外部依赖项的更新(示例范围:gulp, broccoli, npm) |
114
- | ci | 对 CI 配置文件和脚本的更改(例如 scopes: Travis, Circle, BrowserStack, SauceLabs) |
115
- | chore | 其他不修改 src 或测试文件的更改 |
116
- | docs | 只改变文档 |
117
- | feat | 新功能 |
118
- | fix | bug 修复 |
119
- | perf | 改进性能的代码更改 |
120
- | refactor | 既不修复 bug 也不添加新功能的代码更改 |
121
- | revert | 还原以前的提交 |
122
- | style | 不影响代码含义的更改(white-space、格式、缺少分号等) |
123
- | test | 添加缺失的测试或纠正现有的测试 |
124
-
125
- - **使用 `cz` 生成**
126
-
127
- > 格式参考 [What is commitlint]
128
-
129
- 原来使用 `git commit -m "xx"` 改为以下命令(交互方式填写提交信息):
130
-
131
- ```bash
132
- yarn commit
133
- ```
134
-
135
-
136
-
137
- ```bash
138
- npm run commit
139
- ```
90
+ - [JSZip] - 创建、读取和编辑 zip 文件
91
+ <!-- - [data-urls] - 根据 WHATWG Fetch 标准解析 Data URLs -->
140
92
 
141
93
  [lodash]: https://www.npmjs.com/package/lodash
142
94
  [query-string]: https://www.npmjs.com/package/query-string
@@ -150,6 +102,8 @@ npm run commit
150
102
  [tinycolor2]: https://www.npmjs.com/package/tinycolor2
151
103
  [store2]: https://www.npmjs.com/package/store2
152
104
  [uuid]: https://www.npmjs.com/package/uuid
105
+ [jszip]: https://www.npmjs.com/package/jszip
106
+ [data-urls]: https://www.npmjs.com/package/data-urls
153
107
  [npm]: https://img.shields.io/npm/v/util-helpers.svg
154
108
  [npm-url]: https://npmjs.com/package/util-helpers
155
109
  [what is commitlint]: https://github.com/conventional-changelog/commitlint#what-is-commitlint