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

Function get

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

Source from the content-addressed store, hash-verified

850 const wrap = (inner: FumaDb): FumaDb =>
851 new Proxy(inner, {
852 get(target, prop) {
853 if (prop === "withContext") {
854 return (context: unknown) =>
855 wrap((target.withContext as (c: unknown) => FumaDb)(context));
856 }
857 if (prop === "findFirst" || prop === "findMany") {
858 return (table: unknown, query: unknown) =>
859 record(`${String(table)}.${prop}`, () =>
860 (Reflect.get(target, prop) as (t: unknown, q: unknown) => Promise<unknown>).call(
861 target,
862 table,
863 query,
864 ),
865 );
866 }
867 return Reflect.get(target, prop);
868 },
869 });
870 return wrap(db);
871};

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