From: Jérôme Benoit Date: Tue, 11 Jul 2023 21:16:17 +0000 (+0200) Subject: feat(simulator): allow to deprecate only template configuration key X-Git-Tag: v1.2.18~49 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e4c6cf0531872c2a00fcba346e9ee5b46fac3e27;p=e-mobility-charging-stations-simulator.git feat(simulator): allow to deprecate only template configuration key Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStationUtils.ts b/src/charging-station/ChargingStationUtils.ts index 868d0adb..51ea7931 100644 --- a/src/charging-station/ChargingStationUtils.ts +++ b/src/charging-station/ChargingStationUtils.ts @@ -354,10 +354,10 @@ export const warnTemplateKeysDeprecation = ( logPrefix: string, templateFile: string, ) => { - const templateKeys: { key: string; deprecatedKey: string }[] = [ - { key: 'supervisionUrls', deprecatedKey: 'supervisionUrl' }, - { key: 'idTagsFile', deprecatedKey: 'authorizationFile' }, - { key: 'ocppStrictCompliance', deprecatedKey: 'payloadSchemaValidation' }, + const templateKeys: { deprecatedKey: string; key?: string }[] = [ + { deprecatedKey: 'supervisionUrl', key: 'supervisionUrls' }, + { deprecatedKey: 'authorizationFile', key: 'idTagsFile' }, + { deprecatedKey: 'payloadSchemaValidation', key: 'ocppStrictCompliance' }, ]; for (const templateKey of templateKeys) { warnDeprecatedTemplateKey( @@ -365,7 +365,7 @@ export const warnTemplateKeysDeprecation = ( templateKey.deprecatedKey, logPrefix, templateFile, - `Use '${templateKey.key}' instead`, + !isUndefined(templateKey.key) && `Use '${templateKey.key}' instead`, ); convertDeprecatedTemplateKey(stationTemplate, templateKey.deprecatedKey, templateKey.key); }