repositories
/
e-mobility-charging-stations-simulator.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8137295
)
refactor: syntax check in worker configuration section
author
Jérôme Benoit
<jerome.benoit@sap.com>
Sun, 16 Jul 2023 19:40:17 +0000
(21:40 +0200)
committer
Jérôme Benoit
<jerome.benoit@sap.com>
Sun, 16 Jul 2023 19:40:17 +0000
(21:40 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/utils/Configuration.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/utils/Configuration.ts
b/src/utils/Configuration.ts
index b88d340443ac59c863497a8a15fc1af5288d3e3a..d4b4c997dbe0d0f717217d1e141d610e39281eb1 100644
(file)
--- 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;
}