Expose function name to executing function
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user