MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / flattenTree

Function flattenTree

common/src/project-file-tree.ts:267–274  ·  view source on GitHub ↗
(nodes: FileTreeNode[])

Source from the content-addressed store, hash-verified

265}
266
267export function flattenTree(nodes: FileTreeNode[]): FileTreeNode[] {
268 return nodes.flatMap((node) => {
269 if (node.type === 'file') {
270 return [node]
271 }
272 return flattenTree(node.children ?? [])
273 })
274}
275
276export function getLastReadFilePaths(
277 flattenedNodes: FileTreeNode[],

Callers 2

getSystemInfoPromptFunction · 0.90
globFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected