templateFile: string,
logMsgToAppend = '',
): void => {
- if (!isUndefined(template[key])) {
+ if (!isUndefined(template[key as keyof ChargingStationTemplate])) {
const logMsg = `Deprecated template key '${key}' usage in file '${templateFile}'${
isNotEmptyString(logMsgToAppend) ? `. ${logMsgToAppend}` : ''
}`;
deprecatedKey: string,
key?: string,
): void => {
- if (!isUndefined(template[deprecatedKey])) {
+ if (!isUndefined(template[deprecatedKey as keyof ChargingStationTemplate])) {
if (!isUndefined(key)) {
- template[key!] = template[deprecatedKey] as unknown;
+ (template as unknown as Record<string, unknown>)[key!] =
+ template[deprecatedKey as keyof ChargingStationTemplate];
}
- delete template[deprecatedKey];
+ delete template[deprecatedKey as keyof ChargingStationTemplate];
}
};