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

Function get

packages/opencode/src/plugin/tui/runtime.ts:146–158  ·  view source on GitHub ↗
(target, prop)

Source from the content-addressed store, hash-verified

144 const cache = new Map<PropertyKey, unknown>()
145 return new Proxy(keymap, {
146 get(target, prop) {
147 const value = Reflect.get(target, prop, target)
148 if (typeof value !== "function") return value
149 if (cache.has(prop)) return cache.get(prop)
150 const fn = ScopedKeymapMethods.has(prop)
151 ? (...args: unknown[]) => {
152 const dispose = (value as (...args: unknown[]) => unknown).apply(target, args)
153 return scope.track(typeof dispose === "function" ? (dispose as () => void) : undefined)
154 }
155 : (...args: unknown[]) => (value as (...args: unknown[]) => unknown).apply(target, args)
156 cache.set(prop, fn)
157 return fn
158 },
159 })
160}
161

Callers 1

vcs.tsFile · 0.50

Calls 3

applyMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected