From b5b2c3e80ba8b67b3c87b1700abc9d86852ab77a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 16 Jul 2023 21:40:17 +0200 Subject: [PATCH] refactor: syntax check in worker configuration section MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/Configuration.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index b88d3404..d4b4c997 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -327,6 +327,11 @@ export class Configuration { ...deprecatedWorkerConfiguration, ...(hasOwnProp(Configuration.getConfig(), 'worker') && Configuration.getConfig()?.worker), }; + if (!Object.values(WorkerProcessType).includes(workerConfiguration.processType!)) { + throw new SyntaxError( + `Invalid worker process type '${workerConfiguration.processType}' defined in configuration`, + ); + } return workerConfiguration; } -- 2.34.1