(node: TreeNode)
| 178 | }; |
| 179 | |
| 180 | const countLeaves = (node: TreeNode): number => { |
| 181 | let count = node.tool ? 1 : 0; |
| 182 | for (const child of node.children.values()) { |
| 183 | count += countLeaves(child); |
| 184 | } |
| 185 | return count; |
| 186 | }; |
| 187 | |
| 188 | const collectGroupPaths = (node: TreeNode, acc: Set<string>): void => { |
| 189 | for (const child of node.children.values()) { |