if (stationInfo?.Connectors) {
const connectorsConfigHash = crypto
.createHash(Constants.DEFAULT_HASH_ALGORITHM)
- .update(JSON.stringify(stationInfo?.Connectors) + configuredMaxConnectors.toString())
+ .update(`${JSON.stringify(stationInfo?.Connectors)}${configuredMaxConnectors.toString()}`)
.digest('hex');
const connectorsConfigChanged =
this.connectors?.size !== 0 && this.connectorsConfigurationHash !== connectorsConfigHash;
return crypto
.createHash(Constants.DEFAULT_HASH_ALGORITHM)
.update(
- JSON.stringify(chargingStationInfo) +
- ChargingStationUtils.getChargingStationId(index, stationTemplate)
+ `${JSON.stringify(chargingStationInfo)}${ChargingStationUtils.getChargingStationId(
+ index,
+ stationTemplate
+ )}`
)
.digest('hex');
}
: '';
stationInfo.chargePointSerialNumber =
stationTemplate?.chargePointSerialNumberPrefix &&
- stationTemplate.chargePointSerialNumberPrefix + serialNumberSuffix;
+ `${stationTemplate.chargePointSerialNumberPrefix}${serialNumberSuffix}`;
stationInfo.chargeBoxSerialNumber =
stationTemplate?.chargeBoxSerialNumberPrefix &&
- stationTemplate.chargeBoxSerialNumberPrefix + serialNumberSuffix;
+ `${stationTemplate.chargeBoxSerialNumberPrefix}${serialNumberSuffix}`;
stationInfo.meterSerialNumber =
stationTemplate?.meterSerialNumberPrefix &&
- stationTemplate.meterSerialNumberPrefix + serialNumberSuffix;
+ `${stationTemplate.meterSerialNumberPrefix}${serialNumberSuffix}`;
}
public static propagateSerialNumber(
}
private getChargingStationConfigurationKey(hash: string): string {
- return CacheType.CHARGING_STATION_CONFIGURATION + hash;
+ return `${CacheType.CHARGING_STATION_CONFIGURATION}${hash}`;
}
private getChargingStationTemplateKey(hash: string): string {
- return CacheType.CHARGING_STATION_TEMPLATE + hash;
+ return `${CacheType.CHARGING_STATION_TEMPLATE}${hash}`;
}
private has(key: string): boolean {
path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../'),
diagnosticsArchive
),
- uri.pathname + diagnosticsArchive
+ `${uri.pathname}${diagnosticsArchive}`
);
if (uploadResponse.code === 226) {
await chargingStation.ocppRequestService.requestHandler<
}
public static beginMeasure(id: string): string {
- const markId = `${id.charAt(0).toUpperCase() + id.slice(1)}~${Utils.generateUUID()}`;
+ const markId = `${id.charAt(0).toUpperCase()}${id.slice(1)}~${Utils.generateUUID()}`;
performance.mark(markId);
return markId;
}
for await (const tenantID of config.tenantIDs) {
const response = await db
- .collection(tenantID + '.chargingstations')
+ .collection(`${tenantID}.chargingstations`)
.deleteMany({ _id: { $regex: config.idPattern } });
console.info(
response.deletedCount,
for await (const tenantID of config.tenantIDs) {
const response = await db
- .collection(tenantID + '.chargingstations')
+ .collection(`${tenantID}.chargingstations`)
.updateMany({ _id: { $regex: config.idPattern } }, { $set: { public: config.publicFlag } });
console.info(
response.modifiedCount,
}
private static logPrefix(): string {
- return new Date().toLocaleString() + ' Simulator configuration |';
+ return `${new Date().toLocaleString()} Simulator configuration |`;
}
private static warnDeprecatedConfigurationKey(
error: NodeJS.ErrnoException,
params: HandleErrorParams<EmptyObject> = { throwError: true }
): void {
- const prefix = logPrefix.length !== 0 ? logPrefix + ' ' : '';
+ const prefix = logPrefix.trim().length !== 0 ? `${logPrefix} ` : '';
let logMsg: string;
switch (error.code) {
case 'ENOENT':
error: NodeJS.ErrnoException,
params: HandleErrorParams<EmptyObject> = { throwError: true, consoleOut: false }
): void {
- const prefix = !Utils.isEmptyString(logPrefix) ? logPrefix + ' ' : '';
+ const prefix = !Utils.isEmptyString(logPrefix) ? `${logPrefix} ` : '';
let logMsg: string;
switch (error.code) {
case 'ENOENT':
}
public static logPrefix(prefixString = ''): string {
- return new Date().toLocaleString() + prefixString;
+ return `${new Date().toLocaleString()} ${prefixString}`;
}
public static generateUUID(): string {
mountPath: '/proxy',
proxyTo: 'ws://server.example.com',
preProcessor: function (data) {
- console.info('From the client: ' + data);
+ console.info(`From the client: ${data}`);
},
postProcessor: function (data) {
- console.info('From the server: ' + data);
+ console.info(`From the server: ${data}`);
},
}),