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

Function getContext

tests/utils/errorContext.mjs:6–13  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4const contextMap = new Map();
5
6export function getContext() {
7 try {
8 throw new Error();
9 } catch (e) {
10 const key = e.stack.match(/🫨🫨.+?🫨🫨/)?.[0];
11 return contextMap.get(key);
12 }
13}
14
15/** @param {any} value @param {() => Promise<any>} func */
16export async function createContext(value, func) {

Callers 1

assertFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected