tools-min-ns 1.5.2

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 (162) hide show
  1. package/README.md +85 -0
  2. package/esm/array/ArrayUtil.d.ts +109 -0
  3. package/esm/array/ArrayUtil.js +242 -0
  4. package/esm/array/TreeUtil.d.ts +151 -0
  5. package/esm/array/TreeUtil.js +412 -0
  6. package/esm/base/BaseUtil.d.ts +91 -0
  7. package/esm/base/BaseUtil.js +148 -0
  8. package/esm/browser/BrowserUtil.d.ts +57 -0
  9. package/esm/browser/BrowserUtil.js +337 -0
  10. package/esm/browser/fingerprint.d.ts +120 -0
  11. package/esm/browser/fingerprint.js +1469 -0
  12. package/esm/check/CheckUtil.d.ts +110 -0
  13. package/esm/check/CheckUtil.js +465 -0
  14. package/esm/common.d.ts +43 -0
  15. package/esm/common.js +44 -0
  16. package/esm/config.d.ts +7 -0
  17. package/esm/config.js +7 -0
  18. package/esm/cookie/CookieUtil.d.ts +56 -0
  19. package/esm/cookie/CookieUtil.js +12 -0
  20. package/esm/cookie/cookie.d.ts +2 -0
  21. package/esm/cookie/cookie.js +104 -0
  22. package/esm/date/DateUtil.d.ts +261 -0
  23. package/esm/date/DateUtil.js +763 -0
  24. package/esm/env/EnvUtil.d.ts +27 -0
  25. package/esm/env/EnvUtil.js +29 -0
  26. package/esm/env/env.d.ts +41 -0
  27. package/esm/env/env.js +106 -0
  28. package/esm/func/FunctionUtil.d.ts +77 -0
  29. package/esm/func/FunctionUtil.js +215 -0
  30. package/esm/index.d.ts +19 -0
  31. package/esm/index.js +19 -0
  32. package/esm/number/NumberUtil.d.ts +96 -0
  33. package/esm/number/NumberUtil.js +256 -0
  34. package/esm/object/ObjectUtil.d.ts +41 -0
  35. package/esm/object/ObjectUtil.js +158 -0
  36. package/esm/pwd/PasswordUtil.d.ts +33 -0
  37. package/esm/pwd/PasswordUtil.js +68 -0
  38. package/esm/pwd/crypto.d.ts +6 -0
  39. package/esm/pwd/crypto.js +1824 -0
  40. package/esm/request/RequestUtil.d.ts +52 -0
  41. package/esm/request/RequestUtil.js +53 -0
  42. package/esm/request/jsonp.d.ts +18 -0
  43. package/esm/request/jsonp.js +73 -0
  44. package/esm/request/mgop/env.d.ts +7 -0
  45. package/esm/request/mgop/env.js +15 -0
  46. package/esm/request/mgop/index.d.ts +3 -0
  47. package/esm/request/mgop/index.js +276 -0
  48. package/esm/request/mgop/responseCode.d.ts +20 -0
  49. package/esm/request/mgop/responseCode.js +37 -0
  50. package/esm/request/mgop/type.d.ts +34 -0
  51. package/esm/request/mgop/type.js +1 -0
  52. package/esm/request/uniRquest/index.d.ts +2 -0
  53. package/esm/request/uniRquest/index.js +66 -0
  54. package/esm/request/uniRquest/miniapp/index.d.ts +2 -0
  55. package/esm/request/uniRquest/miniapp/index.js +29 -0
  56. package/esm/request/uniRquest/miniapp-bytedance/index.d.ts +2 -0
  57. package/esm/request/uniRquest/miniapp-bytedance/index.js +41 -0
  58. package/esm/request/uniRquest/types.d.ts +65 -0
  59. package/esm/request/uniRquest/types.js +36 -0
  60. package/esm/request/uniRquest/utils.d.ts +9 -0
  61. package/esm/request/uniRquest/utils.js +69 -0
  62. package/esm/request/uniRquest/web/index.d.ts +2 -0
  63. package/esm/request/uniRquest/web/index.js +85 -0
  64. package/esm/request/uniRquest/wechat-miniprogram/index.d.ts +2 -0
  65. package/esm/request/uniRquest/wechat-miniprogram/index.js +41 -0
  66. package/esm/request/uniRquest/weex/index.d.ts +14 -0
  67. package/esm/request/uniRquest/weex/index.js +59 -0
  68. package/esm/storage/StorageUtil.d.ts +19 -0
  69. package/esm/storage/StorageUtil.js +75 -0
  70. package/esm/string/StringUtil.d.ts +392 -0
  71. package/esm/string/StringUtil.js +556 -0
  72. package/esm/system/SystemUtil.d.ts +46 -0
  73. package/esm/system/SystemUtil.js +122 -0
  74. package/esm/transfer/MapTransferUtil.d.ts +54 -0
  75. package/esm/transfer/MapTransferUtil.js +160 -0
  76. package/esm/transfer/TransferUtil.d.ts +98 -0
  77. package/esm/transfer/TransferUtil.js +323 -0
  78. package/esm/types.d.ts +25 -0
  79. package/esm/types.js +1 -0
  80. package/esm/url/UrlUtil.d.ts +30 -0
  81. package/esm/url/UrlUtil.js +85 -0
  82. package/lib/array/ArrayUtil.d.ts +109 -0
  83. package/lib/array/ArrayUtil.js +252 -0
  84. package/lib/array/TreeUtil.d.ts +151 -0
  85. package/lib/array/TreeUtil.js +422 -0
  86. package/lib/base/BaseUtil.d.ts +91 -0
  87. package/lib/base/BaseUtil.js +153 -0
  88. package/lib/browser/BrowserUtil.d.ts +57 -0
  89. package/lib/browser/BrowserUtil.js +347 -0
  90. package/lib/browser/fingerprint.d.ts +120 -0
  91. package/lib/browser/fingerprint.js +1500 -0
  92. package/lib/check/CheckUtil.d.ts +110 -0
  93. package/lib/check/CheckUtil.js +475 -0
  94. package/lib/common.d.ts +43 -0
  95. package/lib/common.js +50 -0
  96. package/lib/config.d.ts +7 -0
  97. package/lib/config.js +12 -0
  98. package/lib/cookie/CookieUtil.d.ts +56 -0
  99. package/lib/cookie/CookieUtil.js +22 -0
  100. package/lib/cookie/cookie.d.ts +2 -0
  101. package/lib/cookie/cookie.js +109 -0
  102. package/lib/date/DateUtil.d.ts +261 -0
  103. package/lib/date/DateUtil.js +773 -0
  104. package/lib/env/EnvUtil.d.ts +27 -0
  105. package/lib/env/EnvUtil.js +39 -0
  106. package/lib/env/env.d.ts +41 -0
  107. package/lib/env/env.js +112 -0
  108. package/lib/func/FunctionUtil.d.ts +77 -0
  109. package/lib/func/FunctionUtil.js +225 -0
  110. package/lib/index.d.ts +19 -0
  111. package/lib/index.js +144 -0
  112. package/lib/number/NumberUtil.d.ts +96 -0
  113. package/lib/number/NumberUtil.js +266 -0
  114. package/lib/object/ObjectUtil.d.ts +41 -0
  115. package/lib/object/ObjectUtil.js +168 -0
  116. package/lib/pwd/PasswordUtil.d.ts +33 -0
  117. package/lib/pwd/PasswordUtil.js +78 -0
  118. package/lib/pwd/crypto.d.ts +6 -0
  119. package/lib/pwd/crypto.js +1829 -0
  120. package/lib/request/RequestUtil.d.ts +52 -0
  121. package/lib/request/RequestUtil.js +94 -0
  122. package/lib/request/jsonp.d.ts +18 -0
  123. package/lib/request/jsonp.js +80 -0
  124. package/lib/request/mgop/env.d.ts +7 -0
  125. package/lib/request/mgop/env.js +21 -0
  126. package/lib/request/mgop/index.d.ts +3 -0
  127. package/lib/request/mgop/index.js +289 -0
  128. package/lib/request/mgop/responseCode.d.ts +20 -0
  129. package/lib/request/mgop/responseCode.js +42 -0
  130. package/lib/request/mgop/type.d.ts +34 -0
  131. package/lib/request/mgop/type.js +5 -0
  132. package/lib/request/uniRquest/index.d.ts +2 -0
  133. package/lib/request/uniRquest/index.js +77 -0
  134. package/lib/request/uniRquest/miniapp/index.d.ts +2 -0
  135. package/lib/request/uniRquest/miniapp/index.js +35 -0
  136. package/lib/request/uniRquest/miniapp-bytedance/index.d.ts +2 -0
  137. package/lib/request/uniRquest/miniapp-bytedance/index.js +47 -0
  138. package/lib/request/uniRquest/types.d.ts +65 -0
  139. package/lib/request/uniRquest/types.js +42 -0
  140. package/lib/request/uniRquest/utils.d.ts +9 -0
  141. package/lib/request/uniRquest/utils.js +83 -0
  142. package/lib/request/uniRquest/web/index.d.ts +2 -0
  143. package/lib/request/uniRquest/web/index.js +91 -0
  144. package/lib/request/uniRquest/wechat-miniprogram/index.d.ts +2 -0
  145. package/lib/request/uniRquest/wechat-miniprogram/index.js +47 -0
  146. package/lib/request/uniRquest/weex/index.d.ts +14 -0
  147. package/lib/request/uniRquest/weex/index.js +65 -0
  148. package/lib/storage/StorageUtil.d.ts +19 -0
  149. package/lib/storage/StorageUtil.js +85 -0
  150. package/lib/string/StringUtil.d.ts +392 -0
  151. package/lib/string/StringUtil.js +566 -0
  152. package/lib/system/SystemUtil.d.ts +46 -0
  153. package/lib/system/SystemUtil.js +132 -0
  154. package/lib/transfer/MapTransferUtil.d.ts +54 -0
  155. package/lib/transfer/MapTransferUtil.js +165 -0
  156. package/lib/transfer/TransferUtil.d.ts +98 -0
  157. package/lib/transfer/TransferUtil.js +333 -0
  158. package/lib/types.d.ts +25 -0
  159. package/lib/types.js +5 -0
  160. package/lib/url/UrlUtil.d.ts +30 -0
  161. package/lib/url/UrlUtil.js +95 -0
  162. package/package.json +56 -0
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * 数组工具
5
+ * @description
6
+ * @author nanshen
7
+ * @creat 2021-09-15 10:31:35
8
+ */
9
+ var __read = this && this.__read || function (o, n) {
10
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
11
+ if (!m) return o;
12
+ var i = m.call(o),
13
+ r,
14
+ ar = [],
15
+ e;
16
+ try {
17
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
18
+ } catch (error) {
19
+ e = {
20
+ error: error
21
+ };
22
+ } finally {
23
+ try {
24
+ if (r && !r.done && (m = i["return"])) m.call(i);
25
+ } finally {
26
+ if (e) throw e.error;
27
+ }
28
+ }
29
+ return ar;
30
+ };
31
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
32
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
33
+ if (ar || !(i in from)) {
34
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
35
+ ar[i] = from[i];
36
+ }
37
+ }
38
+ return to.concat(ar || Array.prototype.slice.call(from));
39
+ };
40
+ var __importDefault = this && this.__importDefault || function (mod) {
41
+ return mod && mod.__esModule ? mod : {
42
+ "default": mod
43
+ };
44
+ };
45
+ Object.defineProperty(exports, "__esModule", {
46
+ value: true
47
+ });
48
+ var NumberUtil_1 = __importDefault(require("../number/NumberUtil"));
49
+ var ArrayUtil;
50
+ (function (ArrayUtil) {
51
+ /**
52
+ * 对象数组去重
53
+ * @param array 去重对象
54
+ * @param key 去重key
55
+ * @param isSaveLast 默认true ,true返回重复最后一个对象,false返回重复第一个对象
56
+ * @example
57
+ * const array = [{a:1,b:3},{a:1,b:2},{a:2,b:1}]
58
+ * arrayWeightRemoval(array,'a',true) => [{a:1,b:2},{a:2,b:1}]
59
+ * arrayWeightRemoval(array,'a',false) => [{a:1,b:3},{a:2,b:1}]
60
+ */
61
+ ArrayUtil.arrayWeightRemoval = function (array, key, isSaveLast) {
62
+ var _a;
63
+ if (array === void 0) {
64
+ array = [];
65
+ }
66
+ if (isSaveLast === void 0) {
67
+ isSaveLast = true;
68
+ }
69
+ if (!array.length || key === undefined || ((_a = array === null || array === void 0 ? void 0 : array[0]) === null || _a === void 0 ? void 0 : _a[key]) === undefined) {
70
+ return [];
71
+ }
72
+ var arrayMap = new Map();
73
+ var region = [];
74
+ array.forEach(function (element) {
75
+ if (isSaveLast) {
76
+ arrayMap.set(element[key], element);
77
+ } else {
78
+ if (!arrayMap.has(element[key])) arrayMap.set(element[key], element);
79
+ }
80
+ });
81
+ arrayMap.forEach(function (ele) {
82
+ if (ele) {
83
+ region.push(ele);
84
+ }
85
+ });
86
+ return region;
87
+ };
88
+ /**
89
+ * 数组去重
90
+ * @param { (number | string)[]} arr 数组
91
+ * @example
92
+ * unique([1,3,1]) =>[1,3]
93
+ */
94
+ ArrayUtil.unique = function (arr) {
95
+ if (!(arr === null || arr === void 0 ? void 0 : arr.length)) return [];
96
+ var list = __spreadArray([], __read(new Set(arr)), false);
97
+ return list;
98
+ };
99
+ /**
100
+ * 求两个集合的并集
101
+ * @param { (number | string)[]} a 集合a
102
+ * @param { (number | string)[]} b 集合b
103
+ * @example
104
+ * union([1,3,4],[1,2]) => [1,2,3,4]
105
+ */
106
+ ArrayUtil.union = function (a, b) {
107
+ if (!(a === null || a === void 0 ? void 0 : a.length)) return [];
108
+ if (!(b === null || b === void 0 ? void 0 : b.length)) return [];
109
+ var aArr = new Set(a);
110
+ var bArr = new Set(b);
111
+ var list = __spreadArray([], __read(new Set(__spreadArray(__spreadArray([], __read(aArr), false), __read(bArr), false))), false);
112
+ return list;
113
+ };
114
+ /**
115
+ * 求两个集合的交集
116
+ * @param { (number | string)[]} a 集合a
117
+ * @param { (number | string)[]} b 集合b
118
+ * @example
119
+ * intersect([1,3,4],[1,2]) => [1]
120
+ */
121
+ ArrayUtil.intersect = function (a, b) {
122
+ if (!(a === null || a === void 0 ? void 0 : a.length)) return [];
123
+ if (!(b === null || b === void 0 ? void 0 : b.length)) return [];
124
+ var aArr = new Set(a);
125
+ var bArr = new Set(b);
126
+ var list = __spreadArray([], __read(new Set(__spreadArray([], __read(aArr), false).filter(function (x) {
127
+ return bArr.has(x);
128
+ }))), false);
129
+ return list;
130
+ };
131
+ /**
132
+ * 求两个集合的差集
133
+ * @param { (number | string)[]} a 集合a
134
+ * @param { (number | string)[]} b 集合b
135
+ * @example
136
+ * difference([1,2,3],[1]) => [2,3]
137
+ */
138
+ ArrayUtil.difference = function (a, b) {
139
+ var aArr = new Set(a);
140
+ var bArr = new Set(b);
141
+ var list = __spreadArray([], __read(new Set(__spreadArray([], __read(aArr), false).filter(function (x) {
142
+ return !bArr.has(x);
143
+ }))), false);
144
+ return list;
145
+ };
146
+ /**
147
+ * 最大值
148
+ * @param {number[]} arr 数组
149
+ * @example
150
+ * max([1,2,3]) => 3
151
+ */
152
+ ArrayUtil.max = function (arr) {
153
+ if (!(arr === null || arr === void 0 ? void 0 : arr.length)) return 0;
154
+ return Math.max.apply(null, arr);
155
+ };
156
+ /**
157
+ * 最小值
158
+ * @export
159
+ * @param {number[]} arr 数组
160
+ * @example
161
+ * min([1,2,3]) => 1
162
+ */
163
+ ArrayUtil.min = function (arr) {
164
+ if (!(arr === null || arr === void 0 ? void 0 : arr.length)) return 0;
165
+ return Math.min.apply(null, arr);
166
+ };
167
+ /**
168
+ * 求和
169
+ * @export
170
+ * @param {number[]} arr 数字数组
171
+ * @example
172
+ * sum([1,2]) => 3
173
+ */
174
+ ArrayUtil.sum = function (arr) {
175
+ return arr.reduce(function (a, b) {
176
+ return NumberUtil_1.default.floatAdd(a, b);
177
+ }, 0);
178
+ };
179
+ /**
180
+ * 平均值
181
+ * @export
182
+ * @param {number[]} arr 数字数组
183
+ * @example
184
+ * average([1,2,3]) => 2
185
+ */
186
+ ArrayUtil.average = function (arr) {
187
+ if (!(arr === null || arr === void 0 ? void 0 : arr.length)) return 0;
188
+ return ArrayUtil.sum(arr) / arr.length;
189
+ };
190
+ /**
191
+ * 删除其中一个元素
192
+ * @export
193
+ * @param {(number | string)[]} arr 数组
194
+ * @param {(number | string)} ele 要删除的元素
195
+ * @example
196
+ * remove([1,2,3],3) => [1,2]
197
+ */
198
+ ArrayUtil.remove = function (arr, ele) {
199
+ if (!(arr === null || arr === void 0 ? void 0 : arr.length)) return [];
200
+ var index = arr.indexOf(ele);
201
+ if (index > -1) {
202
+ arr.splice(index, 1);
203
+ }
204
+ return arr;
205
+ };
206
+ /**
207
+ * 数组排序
208
+ * @param {number[]} arr 数组
209
+ * @param {number} type 1:从小到大 2:从大到小 3:随机
210
+ * @example
211
+ * sort([1,2,3],1) => [1,2,3]
212
+ * sort([1,2,3],2) => [3,2,1]
213
+ * sort([1,2,3],3) => [1,3,2]
214
+ */
215
+ ArrayUtil.sort = function (arr, type) {
216
+ if (type === void 0) {
217
+ type = 1;
218
+ }
219
+ if (!(arr === null || arr === void 0 ? void 0 : arr.length)) return [];
220
+ return arr.sort(function (a, b) {
221
+ switch (type) {
222
+ case 1:
223
+ return a - b;
224
+ case 2:
225
+ return b - a;
226
+ case 3:
227
+ return Math.random() - 0.5;
228
+ default:
229
+ return a - b;
230
+ }
231
+ });
232
+ };
233
+ /**
234
+ * 随机排序数组
235
+ * @param arr any[]
236
+ * @example
237
+ * randomSortArr([1,2,3]) => [1,3,2]
238
+ * randomSortArr([{a:1},{a:2},{a:3}]) => [{a:3},{a:1},{a:2}]
239
+ */
240
+ function randomSortArr(arr) {
241
+ var _a;
242
+ return new Array((_a = arr === null || arr === void 0 ? void 0 : arr.length) !== null && _a !== void 0 ? _a : 0).fill(0).map(function (_, i) {
243
+ return i;
244
+ }).sort(function () {
245
+ return Math.random() - 0.5;
246
+ }).map(function (index) {
247
+ return arr[index];
248
+ });
249
+ }
250
+ ArrayUtil.randomSortArr = randomSortArr;
251
+ })(ArrayUtil || (ArrayUtil = {}));
252
+ exports.default = ArrayUtil;
@@ -0,0 +1,151 @@
1
+ /**
2
+ * 树工具
3
+ * @description
4
+ * @author nanshen
5
+ * @creat 2021-09-15 10:31:35
6
+ */
7
+ import { FieldNames, TreeData, ValueType } from '../types';
8
+ declare namespace TreeUtil {
9
+ /**
10
+ * @name 循环树改变原数组
11
+ * @param tree tree数组
12
+ * @param callback 回调(item:当前循环项,parent: 父对象)
13
+ * @param children children字段
14
+ * @param defaultParent 默认上级对象
15
+ *
16
+ */
17
+ function forEachTree<T>(tree: T[], callback: (t: T, p?: T) => void, children?: string, defaultParent?: T): T[];
18
+ /**
19
+ * @name 查找树
20
+ * @param tree tree数组
21
+ * @param callback 回调(item:当前循环项,parent: 父对象)
22
+ * @param children children字段
23
+ * @param defaultParent 默认上级对象
24
+ */
25
+ function findTreeData<T>(tree: T[], callback: (t: T, p?: T) => boolean, children?: string, defaultParent?: T): T | undefined;
26
+ /**
27
+ * @name 筛选树
28
+ * @param tree tree数组
29
+ * @param callback 回调(item:当前循环项,parent: 父对象)
30
+ * @param children children字段
31
+ * @param defaultParent 默认上级对象
32
+ */
33
+ function filterTreeData<T>(tree: T[], callback: (t: T, p?: T) => boolean, children?: string, defaultParent?: T): T[];
34
+ /**
35
+ * @name 列表转树
36
+ * @param list 数组
37
+ * @param fieldNames 映射对象
38
+ */
39
+ function getTreeByList<T>(list: T[], fieldNames?: FieldNames): (T & TreeData)[];
40
+ /**
41
+ * @name 树转列表
42
+ * @param tree 数组
43
+ */
44
+ function getListByTree<T>(tree: T[], children?: string): T[];
45
+ /**
46
+ * @name 获取树中id路径数组
47
+ * @param tree 树
48
+ * @param id 主键
49
+ * @param fieldNames 映射对象
50
+ */
51
+ function getIdPathByTree<T>(tree: T[], id: ValueType, fieldNames?: FieldNames): ValueType[];
52
+ /**
53
+ * @name 字符串分割转为树结构
54
+ * @param str string
55
+ * @param splitStr /
56
+ * @param fieldNames 映射对象
57
+ * @example
58
+ *
59
+ * `一级选项 1/二级选项 1/三级选项 1
60
+ 一级选项 1/二级选项 1/三级选项 2
61
+ 一级选项 2/二级选项 1`
62
+ //转换后
63
+ [
64
+ {
65
+ name: '一级选项 1',
66
+ id: '一级选项 1',
67
+ children: [
68
+ {
69
+ name: '二级选项 1',
70
+ id: '二级选项 1',
71
+ pid: '一级选项 1',
72
+ children: [
73
+ {
74
+ name: '三级选项 1',
75
+ id: '三级选项 1',
76
+ pid: '二级选项 1',
77
+ },
78
+ {
79
+ name: '三级选项 2',
80
+ id: '三级选项 2',
81
+ pid: '二级选项 1',
82
+ },
83
+ ],
84
+ },
85
+ ],
86
+ },
87
+ {
88
+ name: '一级选项 2',
89
+ id: '一级选项 2',
90
+ children: [
91
+ {
92
+ name: '二级选项 1',
93
+ id: '二级选项 1',
94
+ pid: '一级选项 2',
95
+ },
96
+ ],
97
+ },
98
+ ]
99
+ */
100
+ function strSplit2tree(str: string, splitStr?: string, fieldNames?: FieldNames): Record<string, any>[];
101
+ /**
102
+ * @name 树结构转为字符串分割
103
+ * @param tree 树
104
+ * @param splitStr /
105
+ * @param fieldNames 映射对象
106
+ * @example
107
+ *
108
+ * [
109
+ {
110
+ name: '一级选项 1',
111
+ id: '一级选项 1',
112
+ children: [
113
+ {
114
+ name: '二级选项 1',
115
+ id: '二级选项 1',
116
+ pid: '一级选项 1',
117
+ children: [
118
+ {
119
+ name: '三级选项 1',
120
+ id: '三级选项 1',
121
+ pid: '二级选项 1',
122
+ },
123
+ {
124
+ name: '三级选项 2',
125
+ id: '三级选项 2',
126
+ pid: '二级选项 1',
127
+ },
128
+ ],
129
+ },
130
+ ],
131
+ },
132
+ {
133
+ name: '一级选项 2',
134
+ id: '一级选项 2',
135
+ children: [
136
+ {
137
+ name: '二级选项 1',
138
+ id: '二级选项 1',
139
+ pid: '一级选项 2',
140
+ },
141
+ ],
142
+ },
143
+ ]
144
+ //转换后
145
+ `一级选项 1/二级选项 1/三级选项 1
146
+ 一级选项 1/二级选项 1/三级选项 2
147
+ 一级选项 2/二级选项 1`
148
+ */
149
+ function tree2strSplit<T>(tree: T[], splitStr?: string, fieldNames?: FieldNames): string;
150
+ }
151
+ export default TreeUtil;