util-helpers 4.14.1 → 4.15.1
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 +8 -2
- package/dist/util-helpers.js +307 -176
- 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/calculateCursorPosition.js +1 -3
- package/esm/filterTree.js +61 -0
- package/esm/findTreeNode.js +14 -6
- package/esm/findTreeNodes.js +73 -0
- package/esm/findTreeSelect.js +11 -10
- package/esm/index.js +4 -2
- package/esm/listToTree.js +34 -30
- package/esm/parseIdCard.js +10 -13
- package/esm/randomString.js +3 -5
- package/esm/transformFieldNames.doc.js +3 -3
- package/esm/transformFieldNames.js +6 -7
- package/esm/treeToList.js +4 -1
- package/esm/utils/config.js +1 -1
- package/lib/calculateCursorPosition.js +1 -3
- package/lib/filterTree.js +70 -0
- package/lib/findTreeNode.js +13 -6
- package/lib/findTreeNodes.js +82 -0
- package/lib/findTreeSelect.js +11 -10
- package/lib/index.js +16 -2
- package/lib/listToTree.js +34 -30
- package/lib/parseIdCard.js +10 -13
- package/lib/randomString.js +3 -5
- package/lib/transformFieldNames.doc.js +3 -3
- package/lib/transformFieldNames.js +6 -7
- package/lib/treeToList.js +4 -1
- package/lib/utils/config.js +1 -1
- package/package.json +2 -1
- package/types/calculateCursorPosition.d.ts +0 -2
- package/types/filterTree.d.ts +28 -0
- package/types/findTreeNode.d.ts +1 -1
- package/types/findTreeNodes.d.ts +29 -0
- package/types/index.d.ts +4 -2
- package/types/listToTree.d.ts +2 -2
- package/types/transformFieldNames.d.ts +3 -3
package/README.md
CHANGED
|
@@ -53,6 +53,7 @@ formatBankCard('6228480402564890018', { spaceMark: '-' }); // 6228-4804-0256-489
|
|
|
53
53
|
- [blobToDataURL](https://doly-dev.github.io/util-helpers/module-Processor.html#.blobToDataURL) - 将 Blob 或 File 对象转成 data:URL 格式的 Base64 字符串
|
|
54
54
|
- [bytesToSize](https://doly-dev.github.io/util-helpers/module-Processor.html#.bytesToSize) - 字节转换为存储单位
|
|
55
55
|
- [dataURLToBlob](https://doly-dev.github.io/util-helpers/module-Processor.html#.dataURLToBlob) - 将 DataURL 转为 Blob 对象
|
|
56
|
+
- [filterTree](https://doly-dev.github.io/util-helpers/module-Processor.html#.filterTree) - 过滤树节点
|
|
56
57
|
- [formatMoney](https://doly-dev.github.io/util-helpers/module-Processor.html#.formatMoney) - 格式化金额
|
|
57
58
|
- [formatMobile](https://doly-dev.github.io/util-helpers/module-Processor.html#.formatMobile) - 格式化手机号码
|
|
58
59
|
- [formatBankCard](https://doly-dev.github.io/util-helpers/module-Processor.html#.formatBankCard) - 格式化银行卡
|
|
@@ -92,6 +93,7 @@ formatBankCard('6228480402564890018', { spaceMark: '-' }); // 6228-4804-0256-489
|
|
|
92
93
|
- 其他
|
|
93
94
|
- [calculateCursorPosition](https://doly-dev.github.io/util-helpers/module-Other.html#.calculateCursorPosition) - 计算光标位置
|
|
94
95
|
- [findTreeNode](https://doly-dev.github.io/util-helpers/module-Other.html#.findTreeNode) - 查找树结构数据节点
|
|
96
|
+
- [findTreeNodes](https://doly-dev.github.io/util-helpers/module-Other.html#.findTreeNodes) - 查找树结构数据多个节点
|
|
95
97
|
- [findTreeSelect](https://doly-dev.github.io/util-helpers/module-Other.html#.findTreeSelect) - 查找包含当前节点的所有父级节点
|
|
96
98
|
- [randomString](https://doly-dev.github.io/util-helpers/module-Other.html#.randomString) - 随机字符串
|
|
97
99
|
- [strlen](https://doly-dev.github.io/util-helpers/module-Other.html#.strlen) - 字符长度
|
|
@@ -103,13 +105,15 @@ formatBankCard('6228480402564890018', { spaceMark: '-' }); // 6228-4804-0256-489
|
|
|
103
105
|
- [query-string] - URL 解析、序列化
|
|
104
106
|
- [qs] - URL 查询字符串解析和序列化库
|
|
105
107
|
- [js-cookie] - 一个简单,轻量级的 JavaScript API,用于处理 cookie
|
|
106
|
-
- [
|
|
108
|
+
- [store2] - 丰富了 localStorage 和 sessionStorage 功能(JSON,命名空间,扩展等)
|
|
107
109
|
- [dayjs] - 一个轻量的处理时间和日期的 JavaScript 库,和 Moment.js 的 API 设计保持完全一样
|
|
110
|
+
- [date-fns] - 提供了最全面、简单且一致的工具集,用于在浏览器和 Node.js 中操作 JavaScript 日期
|
|
111
|
+
- [moment] - 一个轻量级 JavaScript 日期库,用于解析,验证,操作和格式化日期
|
|
112
|
+
- [ms] - 将各种时间格式转换为毫秒
|
|
108
113
|
- [axios] - 基于 Promise 的 HTTP 客户端,用于浏览器和 node.js
|
|
109
114
|
- [jsencrypt] - 用于执行 OpenSSL RSA 加密,解密和密钥生成的 Javascript 库
|
|
110
115
|
- [crypto-js] - 加密标准的 JavaScript 库
|
|
111
116
|
- [tinycolor2] - JavaScript 颜色工具,用于 JavaScript 中的颜色处理和转换
|
|
112
|
-
- [store2] - 丰富了 localStorage 和 sessionStorage 功能(JSON,命名空间,扩展等)
|
|
113
117
|
- [uuid] - 生成通用唯一识别码(Universally Unique Identifier)
|
|
114
118
|
- [JSZip] - 创建、读取和编辑 zip 文件
|
|
115
119
|
- [ua-parser-js] - 用于从用户代理数据中检测浏览器、引擎、操作系统、CPU 和设备类型/型号
|
|
@@ -120,6 +124,8 @@ formatBankCard('6228480402564890018', { spaceMark: '-' }); // 6228-4804-0256-489
|
|
|
120
124
|
[js-cookie]: https://www.npmjs.com/package/js-cookie
|
|
121
125
|
[moment]: https://www.npmjs.com/package/moment
|
|
122
126
|
[dayjs]: https://www.npmjs.com/package/dayjs
|
|
127
|
+
[date-fns]: https://www.npmjs.com/package/date-fns
|
|
128
|
+
[ms]: https://www.npmjs.com/package/ms
|
|
123
129
|
[axios]: https://www.npmjs.com/package/axios
|
|
124
130
|
[jsencrypt]: https://www.npmjs.com/package/jsencrypt
|
|
125
131
|
[crypto-js]: https://www.npmjs.com/package/crypto-js
|