Add note about config value cast through unknown

This commit is contained in:
Hornwitser committed 2024-01-10 23:29:32 +01:00
1 parent c0f65e0610
commit 1f19f1bfcb
1 file changed
+3
+3
View File
@@ -112,6 +112,9 @@ function getPlugins(req: Request, res: Response) {
let enabled = loaded && req.app.locals.controller.config.get(
`${pluginInfo.name}.load_plugin` as keyof lib.ControllerConfigFields,
) as unknown as boolean;
// Note: Cast through unknown is needed because load_plugin is
// defined at runtime and no other fields in the controller config
// currently have the boolean type.
let web: { main:any, error:string|undefined } = { main: undefined, error: undefined};
let devPlugins = req.app.locals.devPlugins;
if (devPlugins && devPlugins.has(name)) {