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

Function withResolved

packages/opencode/src/storage/storage.ts:255–264  ·  view source on GitHub ↗
(
      key: string[],
      fn: (target: string, rw: TxReentrantLock.TxReentrantLock) => Effect.Effect<A, E>,
    )

Source from the content-addressed store, hash-verified

253 })
254
255 const withResolved = <A, E>(
256 key: string[],
257 fn: (target: string, rw: TxReentrantLock.TxReentrantLock) => Effect.Effect<A, E>,
258 ): Effect.Effect<A, E | FSUtil.Error> =>
259 Effect.scoped(
260 Effect.gen(function* () {
261 const target = file((yield* state).dir, key)
262 return yield* fn(target, yield* RcMap.get(locks, target))
263 }),
264 )
265
266 const remove: Interface["remove"] = Effect.fn("Storage.remove")(function* (key: string[]) {
267 yield* withResolved(key, (target, rw) =>

Callers 4

storage.tsFile · 0.85
readFunction · 0.85
updateFunction · 0.85
writeFunction · 0.85

Calls 3

fileFunction · 0.70
getMethod · 0.65
fnFunction · 0.50

Tested by

no test coverage detected