MCPcopy Create free account
hub / github.com/EmNudge/watlings / createContext

Function createContext

tests/utils/errorContext.mjs:16–27  ·  view source on GitHub ↗
(value, func)

Source from the content-addressed store, hash-verified

14
15/** @param {any} value @param {() => Promise<any>} func */
16export async function createContext(value, func) {
17 const key = "🫨🫨" + Math.random().toString(16) + "🫨🫨";
18 contextMap.set(key, value);
19
20 const fn = {
21 async [key]() {
22 return await func();
23 },
24 }[key];
25 await fn();
26 contextMap.delete(key);
27}

Callers 1

testFunction · 0.90

Calls

no outgoing calls

Tested by 1

testFunction · 0.72