()
| 4 | const contextMap = new Map(); |
| 5 | |
| 6 | export 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 */ |
| 16 | export async function createContext(value, func) { |