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

Function wrap

packages/opencode/src/storage/storage.ts:248–249  ·  view source on GitHub ↗
(target: string, body: Effect.Effect<A, FSUtil.Error>)

Source from the content-addressed store, hash-verified

246 Effect.fail(new NotFoundError({ message: `Resource not found: ${target}` }))
247
248 const wrap = <A>(target: string, body: Effect.Effect<A, FSUtil.Error>) =>
249 body.pipe(Effect.catchIf(missing, () => fail(target)))
250
251 const writeJson = Effect.fnUntraced(function* (target: string, content: unknown) {
252 yield* fs.writeWithDirs(target, JSON.stringify(content, null, 2))

Callers 2

readFunction · 0.70
updateFunction · 0.70

Calls 1

failFunction · 0.70

Tested by

no test coverage detected