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

Function update

packages/enterprise/src/core/storage.ts:122–128  ·  view source on GitHub ↗
(key: string[], fn: (draft: T) => void)

Source from the content-addressed store, hash-verified

120 }
121
122 export async function update<T>(key: string[], fn: (draft: T) => void) {
123 const val = await read<T>(key)
124 if (!val) throw new Error("Not found")
125 fn(val)
126 await write(key, val)
127 return val
128 }
129}

Callers

nothing calls this directly

Calls 2

fnFunction · 0.70
writeFunction · 0.70

Tested by

no test coverage detected