From: Jérôme Benoit Date: Fri, 1 Jan 2021 19:48:43 +0000 (+0100) Subject: More typing X-Git-Tag: v1.0.1-0~152^2~7 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6c4564bcafe1dfd2ce0586f2815d3a1a82dff052;p=e-mobility-charging-stations-simulator.git More typing Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 20058769..63a011dd 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1043,7 +1043,7 @@ export default class ChargingStation { const self = this; // Send a message through wsConnection return new Promise((resolve: (value?: any | PromiseLike) => void, reject: (reason?: any) => void) => { - let messageToSend; + let messageToSend: string; // Type of message switch (messageType) { // Request @@ -1075,7 +1075,7 @@ export default class ChargingStation { // Handle dups in buffer for (const message of this._messageQueue) { // Same message - if (JSON.stringify(messageToSend) === JSON.stringify(message)) { + if (messageToSend === message) { dups = true; break; }