MCPcopy Create free account
hub / github.com/anomalyco/opencode / push

Function push

packages/app/src/components/file-tree.tsx:269–280  ·  view source on GitHub ↗
(dir: string, lvl: number)

Source from the content-addressed store, hash-verified

267 const stack: { dir: string; lvl: number; i: number; kids: string[]; max: number }[] = []
268
269 const push = (dir: string, lvl: number) => {
270 const id = key(dir)
271 if (seen.has(id)) return
272 seen.add(id)
273
274 const kids = file.tree
275 .children(dir)
276 .filter((node) => node.type === "directory" && (file.tree.state(node.path)?.expanded ?? false))
277 .map((node) => node.path)
278
279 stack.push({ dir, lvl, i: 0, kids, max: lvl })
280 }
281
282 push(root, level - 1)
283

Callers 1

FileTreeFunction · 0.70

Calls 5

stateMethod · 0.80
pushMethod · 0.80
keyFunction · 0.70
addMethod · 0.65
childrenMethod · 0.45

Tested by

no test coverage detected