@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/dist/index.cjs +31 -31
- package/dist/index.mjs +12 -12
- package/package.json +1 -1
- package/types/data.d.ts +14 -0
package/package.json
CHANGED
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[];
|