wip fix
This commit is contained in:
parent
7e300e6aba
commit
178533d435
|
|
@ -150,18 +150,22 @@ 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") {
|
||||||
const typings_src = prop.typings.substring(
|
try {
|
||||||
`const typings = `.length
|
const typings_src = prop.typings.substring(
|
||||||
);
|
`const typings = `.length
|
||||||
const typings_fn = new Function(
|
);
|
||||||
`return ${typings_src}`
|
const typings_fn = new Function(
|
||||||
);
|
`return ${typings_src}`
|
||||||
const typings = typings_fn();
|
);
|
||||||
for (const [k, v] of Object.entries(typings)) {
|
const typings = typings_fn();
|
||||||
if (typeof v === "string") {
|
if (typeof typings === "object") {
|
||||||
types[k] = v;
|
for (const [k, v] of Object.entries(typings)) {
|
||||||
|
if (typeof v === "string") {
|
||||||
|
types[k] = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue