From 7d0df16c195e1282e2eaee25c6a3a15c1316797c Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Sat, 26 Jul 2025 20:48:30 +1000 Subject: [PATCH] Expose function name to executing function --- worker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worker.ts b/worker.ts index b77800e..467ff4f 100644 --- a/worker.ts +++ b/worker.ts @@ -6,7 +6,7 @@ const States = Object.freeze({ }); self.onmessage = async (e) => { - const { code, request, environment } = e.data; + const { code, request, environment, name } = e.data; const logs: any[] = []; const startTime = performance.now(); @@ -25,6 +25,7 @@ self.onmessage = async (e) => { try { // Make the environment object and response helpers available globally. (self as any).environment = environment; + (self as any).FUNCTION_NAME = name; (self as any).Response = (body = "", headers = {}, status = 200) => ({ body, status,