MCPcopy Create free account
hub / github.com/anomalyco/opencode / prune

Function prune

packages/app/src/utils/scoped-cache.ts:41–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 }
40
41 const prune = () => {
42 if (options.maxEntries === undefined) return
43 while (store.size > options.maxEntries) {
44 const key = store.keys().next().value
45 if (!key) return
46 const entry = store.get(key)
47 store.delete(key)
48 if (!entry) continue
49 dispose(key, entry)
50 }
51 }
52
53 const remove = (key: string) => {
54 const entry = store.get(key)

Callers 1

getFunction · 0.70

Calls 4

disposeFunction · 0.70
getMethod · 0.65
nextMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected