From: Jérôme Benoit Date: Sun, 16 Jul 2023 19:40:17 +0000 (+0200) Subject: refactor: syntax check in worker configuration section X-Git-Tag: v1.2.18~21 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b5b2c3e80ba8b67b3c87b1700abc9d86852ab77a;p=e-mobility-charging-stations-simulator.git refactor: syntax check in worker configuration section Signed-off-by: Jérôme Benoit --- 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; }