event: ChargingStationWorkerMessageEvents,
eventsToWait: number,
): Promise<number> => {
- return new Promise((resolve) => {
+ return new Promise<number>((resolve) => {
let events = 0;
if (eventsToWait === 0) {
resolve(events);
? getMaxNumberOfConnectors(stationTemplate.Connectors) - 1
: getMaxNumberOfConnectors(stationTemplate.Connectors);
} else if (stationTemplate.Evses && !stationTemplate.Connectors) {
- configuredMaxConnectors = 0;
for (const evse in stationTemplate.Evses) {
if (evse === '0') {
continue;
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];
}
};