repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: strong stype configuration key deprecation helper
[e-mobility-charging-stations-simulator.git]
/
src
/
utils
/
Configuration.ts
diff --git
a/src/utils/Configuration.ts
b/src/utils/Configuration.ts
index e1fd11c731af1024ebfd08dfba373eb82680abc2..9356785deaf2af7dfba30ff313d9bfbf82f8ee34 100644
(file)
--- a/
src/utils/Configuration.ts
+++ b/
src/utils/Configuration.ts
@@
-513,22
+513,22
@@
export class Configuration {
private static warnDeprecatedConfigurationKey (
key: string,
private static warnDeprecatedConfigurationKey (
key: string,
-
sectionName?: string
,
+
configurationSection?: ConfigurationSection
,
logMsgToAppend = ''
): void {
if (
logMsgToAppend = ''
): void {
if (
- sectionName != null &&
- Configuration.getConfigurationData()?.[sectionName as keyof ConfigurationData] != null &&
+ configurationSection != null &&
+ Configuration.getConfigurationData()?.[configurationSection as keyof ConfigurationData] !=
+ null &&
(
(
- Configuration.getConfigurationData()?.[sectionName as keyof ConfigurationData] as Record<
- string,
- unknown
- >
+ Configuration.getConfigurationData()?.[
+ configurationSection as keyof ConfigurationData
+ ] as Record<string, unknown>
)[key] != null
) {
console.error(
`${chalk.green(logPrefix())} ${chalk.red(
)[key] != null
) {
console.error(
`${chalk.green(logPrefix())} ${chalk.red(
- `Deprecated configuration key '${key}' usage in section '${
sectionName
}'${
+ `Deprecated configuration key '${key}' usage in section '${
configurationSection
}'${
logMsgToAppend.trim().length > 0 ? `. ${logMsgToAppend}` : ''
}`
)}`
logMsgToAppend.trim().length > 0 ? `. ${logMsgToAppend}` : ''
}`
)}`