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

Function get

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected