This commit is contained in:
Rizky 2024-07-27 17:22:31 +07:00
parent 98aefbc20c
commit d1dc647f62
1 changed files with 3 additions and 1 deletions

View File

@ -192,7 +192,9 @@ return typings;
i++; i++;
if (v.mode === "local") { if (v.mode === "local") {
const im = tree_types.length; 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 = `\ const local_type = `\
declare module "item-${im}" { declare module "item-${im}" {
export const \$\$_${k} = ${fn.toString()}; export const \$\$_${k} = ${fn.toString()};