MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / get

Function get

packages/core/sdk/src/test-config.ts:74–88  ·  view source on GitHub ↗
(target, prop)

Source from the content-addressed store, hash-verified

72 { internal: context === undefined ? internal : { ...internal, context } },
73 {
74 get(target, prop) {
75 if (prop === "internal") return target.internal;
76 if (prop === "withContext") {
77 return (nextContext: ExecutorOwnerPolicyContext) => makeDb(nextContext);
78 }
79 if (!queryMethods.has(prop)) return undefined;
80
81 return async (...args: unknown[]) => {
82 const actual = await start();
83 const actualDb =
84 context === undefined ? actual.db : withQueryContext(actual.db, context);
85 const method = Reflect.get(actualDb, prop) as (...innerArgs: unknown[]) => unknown;
86 return method.apply(actualDb, args);
87 };
88 },
89 },
90 ) as FumaDb;
91

Callers

nothing calls this directly

Calls 4

withQueryContextFunction · 0.90
makeDbFunction · 0.85
startFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected