From 1f19f1bfcb804fa399c89d5ea9d84a3f4b6d98a6 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 10 Jan 2024 23:29:32 +0100 Subject: [PATCH] Add note about config value cast through unknown --- packages/controller/src/routes.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/controller/src/routes.ts b/packages/controller/src/routes.ts index b56d54f6..852f4b59 100644 --- a/packages/controller/src/routes.ts +++ b/packages/controller/src/routes.ts @@ -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)) {