MCPcopy Create free account
hub / github.com/arctic-cli/interface / fn

Function fn

packages/arctic/src/file/index.ts:126–144  ·  view source on GitHub ↗
(result: Entry)

Source from the content-addressed store, hash-verified

124 let cache: Entry = { files: [], dirs: [] }
125 let fetching = false
126 const fn = async (result: Entry) => {
127 fetching = true
128 const set = new Set<string>()
129 for await (const file of Ripgrep.files({ cwd: Instance.directory })) {
130 result.files.push(file)
131 let current = file
132 while (true) {
133 const dir = path.dirname(current)
134 if (dir === ".") break
135 if (dir === current) break
136 current = dir
137 if (set.has(dir)) continue
138 set.add(dir)
139 result.dirs.push(dir + "/")
140 }
141 }
142 cache = result
143 fetching = false
144 }
145 fn(cache)
146
147 return {

Callers 2

index.tsFile · 0.70
filesFunction · 0.70

Calls 3

pushMethod · 0.80
filesMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected