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

Function list

packages/arctic/src/storage/storage.ts:219–233  ·  view source on GitHub ↗
(prefix: string[])

Source from the content-addressed store, hash-verified

217
218 const glob = new Bun.Glob("**/*")
219 export async function list(prefix: string[]) {
220 const dir = await state().then((x) => x.dir)
221 try {
222 const result = await Array.fromAsync(
223 glob.scan({
224 cwd: path.join(dir, ...prefix),
225 onlyFiles: true,
226 }),
227 ).then((results) => results.map((x) => [...prefix, ...x.slice(0, -5).split(path.sep)]))
228 result.sort()
229 return result
230 } catch {
231 return []
232 }
233 }
234}

Callers

nothing calls this directly

Calls 1

stateFunction · 0.85

Tested by

no test coverage detected