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

Function get

packages/core/sdk/src/connections.test.ts:77–94  ·  view source on GitHub ↗
(target, prop)

Source from the content-addressed store, hash-verified

75 const wrap = (inner: FumaDb): FumaDb =>
76 new Proxy(inner, {
77 get(target, prop) {
78 if (prop === "withContext") {
79 return (context: unknown) =>
80 wrap((target.withContext as (c: unknown) => FumaDb)(context));
81 }
82 if (prop === "transaction") {
83 return async (run: Parameters<FumaDb["transaction"]>[0]) => {
84 hooks.enter();
85 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: test instrument must unwind on both outcomes
86 try {
87 return await target.transaction(run);
88 } finally {
89 hooks.exit();
90 }
91 };
92 }
93 return Reflect.get(target, prop);
94 },
95 });
96 return wrap(db);
97};

Callers

nothing calls this directly

Calls 7

interceptHealthWritesFunction · 0.85
resolveMethod · 0.80
callMethod · 0.80
wrapFunction · 0.70
runFunction · 0.70
transactionMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected