(node: PathTreeNode)
| 92 | } |
| 93 | |
| 94 | function flattenSingleChildChain(node: PathTreeNode): PathTreeNode { |
| 95 | let current = node; |
| 96 | while (current.children.size === 1 && current.label === undefined) { |
| 97 | const onlyChild = current.children.values().next().value; |
| 98 | if (!onlyChild) break; |
| 99 | current = onlyChild; |
| 100 | } |
| 101 | return current; |
| 102 | } |
| 103 | |
| 104 | function renderNode( |
| 105 | node: PathTreeNode, |