@vtj/base 0.9.0-alpha.0 → 0.9.0-alpha.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/base",
3
3
  "private": false,
4
- "version": "0.9.0-alpha.0",
4
+ "version": "0.9.0-alpha.2",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "@types/lodash-es": "~4.17.12",
package/types/data.d.ts CHANGED
@@ -96,3 +96,17 @@ export declare function splitParser(val?: string, flag?: string): string[];
96
96
  * @returns
97
97
  */
98
98
  export declare function splitStringify(val?: string[], flag?: string): string;
99
+ /**
100
+ * 数组转换为树结构
101
+ * @param array
102
+ * @param id
103
+ * @param parentId
104
+ * @returns
105
+ */
106
+ export declare function arrayToTree<T extends Record<string, any>>(array: T[], id?: keyof T, parentId?: keyof T, children?: string, root?: string | number): T[];
107
+ /**
108
+ * 树结构扁平化
109
+ * @param array
110
+ * @returns
111
+ */
112
+ export declare function flatChildren(array?: any[]): any[];