MCPcopy Index your code
hub / github.com/anomalyco/opencode / read

Function read

packages/desktop/scripts/finalize-latest-json.ts:95–99  ·  view source on GitHub ↗
(sub: string, file: string)

Source from the content-addressed store, hash-verified

93}
94
95async function read(sub: string, file: string) {
96 const item = Bun.file(path.join(root, sub, file))
97 if (!(await item.exists())) return undefined
98 return parse(await item.text())
99}
100
101function pick(list: Item[], exts: string[]) {
102 for (const ext of exts) {

Callers 1

Calls 4

fileMethod · 0.80
parseFunction · 0.70
textMethod · 0.65
existsMethod · 0.45

Tested by

no test coverage detected