MCPcopy
hub / github.com/npmx-dev/npmx.dev / traverse

Function traverse

server/utils/import-resolver.ts:13–21  ·  view source on GitHub ↗
(nodes: PackageFileTree[])

Source from the content-addressed store, hash-verified

11 const files = new Set<string>()
12
13 function traverse(nodes: PackageFileTree[]) {
14 for (const node of nodes) {
15 if (node.type === 'file') {
16 files.add(node.path)
17 } else if (node.children) {
18 traverse(node.children)
19 }
20 }
21 }
22
23 traverse(tree)
24 return files

Callers 1

flattenFileTreeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected