From d1dc647f62d6f2b3126a1c4df020e22dc856677d Mon Sep 17 00:00:00 2001 From: Rizky Date: Sat, 27 Jul 2024 17:22:31 +0700 Subject: [PATCH] fix --- app/web/src/nova/ed/panel/popup/script/scope/scope.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/web/src/nova/ed/panel/popup/script/scope/scope.tsx b/app/web/src/nova/ed/panel/popup/script/scope/scope.tsx index 174567b2..58a40ad7 100644 --- a/app/web/src/nova/ed/panel/popup/script/scope/scope.tsx +++ b/app/web/src/nova/ed/panel/popup/script/scope/scope.tsx @@ -192,7 +192,9 @@ return typings; i++; if (v.mode === "local") { const im = tree_types.length; - const fn = new Function(`return ${v.val}`); + const fn = new Function( + `return ${typeof v.val === "string" ? v.val : JSON.stringify(v.val)}` + ); const local_type = `\ declare module "item-${im}" { export const \$\$_${k} = ${fn.toString()};