X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FConfiguration.ts;h=90e846036074be5f3b71146df687313706b9cd3f;hb=7436ee0df05bb41f3ce8a553adf5d9ed8da78903;hp=7d5b217d5faafa331c8b16ae4768e65003e9c691;hpb=617cad0c86c3fea53b56a738bb0d6ddc3da05237;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 7d5b217d..90e84603 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -129,15 +129,17 @@ export class Configuration { (Configuration.getConfig().stationTemplateUrls = Configuration.getConfig()[ 'stationTemplateURLs' ] as StationTemplateUrl[]); - Configuration.getConfig().stationTemplateUrls.forEach((stationUrl: StationTemplateUrl) => { - if (!Utils.isUndefined(stationUrl['numberOfStation'])) { - console.error( - chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key 'numberOfStation' usage for template file '${ - stationUrl.file - }' in 'stationTemplateUrls'. Use 'numberOfStations' instead}` - ); + Configuration.getConfig().stationTemplateUrls.forEach( + (stationTemplateUrl: StationTemplateUrl) => { + if (!Utils.isUndefined(stationTemplateUrl['numberOfStation'])) { + console.error( + chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key 'numberOfStation' usage for template file '${ + stationTemplateUrl.file + }' in 'stationTemplateUrls'. Use 'numberOfStations' instead}` + ); + } } - }); + ); // Read conf return Configuration.getConfig()?.stationTemplateUrls; } @@ -322,13 +324,13 @@ export class Configuration { ) { console.error( chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage in section '${sectionName}'${ - logMsgToAppend.trim().length > 0 && `. ${logMsgToAppend}` + logMsgToAppend.trim().length > 0 ? `. ${logMsgToAppend}` : '' }}` ); } else if (!Utils.isUndefined(Configuration.getConfig()[key])) { console.error( chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage${ - logMsgToAppend.trim().length > 0 && `. ${logMsgToAppend}` + logMsgToAppend.trim().length > 0 ? `. ${logMsgToAppend}` : '' }}` ); }