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

Function get

packages/app/src/utils/scoped-cache.ts:70–89  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

68 }
69
70 const get = (key: string) => {
71 sweep()
72 const entry = store.get(key)
73 if (entry && !expired(entry)) {
74 touch(key, entry)
75 return entry.value
76 }
77 if (entry) {
78 store.delete(key)
79 dispose(key, entry)
80 }
81
82 const created = {
83 value: createValue(key),
84 touchedAt: now(),
85 }
86 store.set(key, created)
87 prune()
88 return created.value
89 }
90
91 const clear = () => {
92 for (const [key, entry] of store) {

Callers

nothing calls this directly

Calls 8

sweepFunction · 0.85
expiredFunction · 0.85
touchFunction · 0.70
disposeFunction · 0.70
pruneFunction · 0.70
getMethod · 0.65
deleteMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected