MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / countLeaves

Function countLeaves

packages/react/src/components/tool-tree.tsx:180–186  ·  view source on GitHub ↗
(node: TreeNode)

Source from the content-addressed store, hash-verified

178};
179
180const 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
188const collectGroupPaths = (node: TreeNode, acc: Set<string>): void => {
189 for (const child of node.children.values()) {

Callers 1

flattenTreeFunction · 0.85

Calls 1

valuesMethod · 0.80

Tested by

no test coverage detected