MCPcopy Create free account
hub / github.com/esengine/esengine / traverse

Function traverse

packages/editor-app/src/components/FileTree.tsx:69–77  ·  view source on GitHub ↗
(nodeList: TreeNode[])

Source from the content-addressed store, hash-verified

67 const getVisibleFilePaths = (nodes: TreeNode[]): string[] => {
68 const paths: string[] = [];
69 const traverse = (nodeList: TreeNode[]) => {
70 for (const node of nodeList) {
71 if (node.type === 'file') {
72 paths.push(node.path);
73 } else if (node.type === 'folder' && node.expanded && node.children) {
74 traverse(node.children);
75 }
76 }
77 };
78 traverse(nodes);
79 return paths;
80 };

Callers 3

getVisibleFilePathsFunction · 0.70
traverseMethod · 0.50
flattenHierarchyMethod · 0.50

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected