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

Function writeCacheText

packages/core/test/models.test.ts:100–108  ·  view source on GitHub ↗
(text: string, mtimeMs?: number)

Source from the content-addressed store, hash-verified

98 )
99
100const writeCacheText = (text: string, mtimeMs?: number) =>
101 Effect.promise(async () => {
102 await mkdir(Global.Path.cache, { recursive: true })
103 await writeFile(cacheFile, text)
104 if (mtimeMs !== undefined) {
105 const t = mtimeMs / 1000
106 await utimes(cacheFile, t, t)
107 }
108 })
109
110const writeCache = (data: object, mtimeMs?: number) => writeCacheText(JSON.stringify(data), mtimeMs)
111

Callers 2

writeCacheFunction · 0.85
models.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected