From bf7a1e1123971c0d839f253519d6a6a42a51579d Mon Sep 17 00:00:00 2001 From: Katsumi Kato Date: Sun, 5 Mar 2023 14:35:24 +0000 Subject: [PATCH] Dump globalThis --- src/JobBroker.ts | 12 +++++++++++- tslint.json | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/JobBroker.ts b/src/JobBroker.ts index 1f3134c..6193bd5 100644 --- a/src/JobBroker.ts +++ b/src/JobBroker.ts @@ -93,7 +93,17 @@ class JobBroker { ); try { - const result = globalThis[parameter.handler]( + console.info( + Object.entries(globalThis).map(([key, value]) => [ + key, + typeof value, + ]) + ); + // const result = globalThis[parameter.handler]( + // JSON.parse(parameter.parameter) + // ); + + const result = eval(parameter.handler)( JSON.parse(parameter.parameter) ); if (!result) { diff --git a/tslint.json b/tslint.json index d5d83ad..454ea7a 100644 --- a/tslint.json +++ b/tslint.json @@ -16,6 +16,9 @@ "no-console": [ false ], + "no-eval": [ + false + ], "variable-name": { "options": [ "allow-snake-case"