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

Function get

packages/core/sdk/src/executor.test.ts:962–978  ·  view source on GitHub ↗
(target, prop)

Source from the content-addressed store, hash-verified

960 const wrap = (inner: FumaDb): FumaDb =>
961 new Proxy(inner, {
962 get(target, prop) {
963 if (prop === "withContext") {
964 return (context: unknown) =>
965 wrap((target.withContext as (c: unknown) => FumaDb)(context));
966 }
967 if (prop === "findFirst" || prop === "findMany") {
968 return (table: unknown, query: unknown) =>
969 record(`${String(table)}.${prop}`, () =>
970 (Reflect.get(target, prop) as (t: unknown, q: unknown) => Promise<unknown>).call(
971 target,
972 table,
973 query,
974 ),
975 );
976 }
977 return Reflect.get(target, prop);
978 },
979 });
980 return wrap(db);
981};

Callers

nothing calls this directly

Calls 4

callMethod · 0.80
wrapFunction · 0.70
recordFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected