MCPcopy Index your code
hub / github.com/dmno-dev/varlock / get

Function get

packages/varlock/src/plugin-context.ts:32–36  ·  view source on GitHub ↗
(_, key)

Source from the content-addressed store, hash-verified

30
31export const pluginProxy: any = new Proxy({} as any, {
32 get(_, key) {
33 if (!ctx.active) throw new Error('[varlock] No active plugin context — are you importing plugin-lib outside of a plugin module?');
34 const val = ctx.active[key];
35 return typeof val === 'function' ? val.bind(ctx.active) : val;
36 },
37 set(_, key, value) {
38 if (!ctx.active) throw new Error('[varlock] No active plugin context');
39 ctx.active[key] = value;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected