Fix that toHierarchy couldn't be found. Updated docs and test.

This commit is contained in:
Bram 2024-12-02 17:44:38 +01:00
commit 048c10a6ab
11 changed files with 70 additions and 47 deletions

9
types/TreeView/treeview.d.ts vendored Normal file
View file

@ -0,0 +1,9 @@
import { type TreeNode } from "carbon-components-svelte/TreeView/TreeView.svelte";
/**
* Create a nested array from a flat array
*/
export function toHierarchy(
flatArray: TreeNode[] & { pid?: any }[],
): TreeNode[];
export default toHierarchy;