This commit is contained in:
Rizky 2024-02-02 14:21:03 +07:00
parent 7e300e6aba
commit 178533d435
1 changed files with 15 additions and 11 deletions

View File

@ -150,6 +150,7 @@ export const EdScriptMonaco: FC<{}> = () => {
const prop_name = p.ui.popup.script.prop_name; const prop_name = p.ui.popup.script.prop_name;
const prop = component.props[prop_name]; const prop = component.props[prop_name];
if (typeof prop.typings === "string") { if (typeof prop.typings === "string") {
try {
const typings_src = prop.typings.substring( const typings_src = prop.typings.substring(
`const typings = `.length `const typings = `.length
); );
@ -157,12 +158,15 @@ export const EdScriptMonaco: FC<{}> = () => {
`return ${typings_src}` `return ${typings_src}`
); );
const typings = typings_fn(); const typings = typings_fn();
if (typeof typings === "object") {
for (const [k, v] of Object.entries(typings)) { for (const [k, v] of Object.entries(typings)) {
if (typeof v === "string") { if (typeof v === "string") {
types[k] = v; types[k] = v;
} }
} }
} }
} catch (e) {}
}
} }
} }
break; break;