MCPcopy Index your code
hub / github.com/codeaashu/claude-code / traverse

Function traverse

src/components/ui/TreeSelect.tsx:160–175  ·  view source on GitHub ↗
(node, depth, parentId)

Source from the content-addressed store, hash-verified

158 if ($[4] !== isExpanded || $[5] !== nodes) {
159 result = [];
160 function traverse(node, depth, parentId) {
161 const hasChildren = !!node.children && node.children.length > 0;
162 const nodeIsExpanded = isExpanded(node.id);
163 result.push({
164 node,
165 depth,
166 isExpanded: nodeIsExpanded,
167 hasChildren,
168 parentId
169 });
170 if (hasChildren && nodeIsExpanded && node.children) {
171 for (const child of node.children) {
172 traverse(child, depth + 1, node.id);
173 }
174 }
175 }
176 for (const node_0 of nodes) {
177 traverse(node_0, 0);
178 }

Callers 1

TreeSelectFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected