From d200b695603b334df62cd82a10f1a73f88fbf54b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 14 May 2022 22:48:36 +0200 Subject: [PATCH] Avoid attribute namespace collision MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- package-lock.json | 14 +++++++------- package.json | 2 +- src/charging-station/ui-server/AbstractUIServer.ts | 2 +- .../ui-server/UIWebSocketServer.ts | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 15c3d84d..8888dbf7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,7 +60,7 @@ "prettier": "^2.6.2", "release-it": "^15.0.0", "robohydra": "^0.6.9", - "rollup": "^2.72.1", + "rollup": "^2.73.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-copy": "^3.4.0", "rollup-plugin-delete": "^2.0.0", @@ -13870,9 +13870,9 @@ } }, "node_modules/rollup": { - "version": "2.72.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.72.1.tgz", - "integrity": "sha512-NTc5UGy/NWFGpSqF1lFY8z9Adri6uhyMLI6LvPAXdBKoPRFhIIiBUpt+Qg2awixqO3xvzSijjhnb4+QEZwJmxA==", + "version": "2.73.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.73.0.tgz", + "integrity": "sha512-h/UngC3S4Zt28mB3g0+2YCMegT5yoftnQplwzPqGZcKvlld5e+kT/QRmJiL+qxGyZKOYpgirWGdLyEO1b0dpLQ==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -27981,9 +27981,9 @@ } }, "rollup": { - "version": "2.72.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.72.1.tgz", - "integrity": "sha512-NTc5UGy/NWFGpSqF1lFY8z9Adri6uhyMLI6LvPAXdBKoPRFhIIiBUpt+Qg2awixqO3xvzSijjhnb4+QEZwJmxA==", + "version": "2.73.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.73.0.tgz", + "integrity": "sha512-h/UngC3S4Zt28mB3g0+2YCMegT5yoftnQplwzPqGZcKvlld5e+kT/QRmJiL+qxGyZKOYpgirWGdLyEO1b0dpLQ==", "dev": true, "requires": { "fsevents": "~2.3.2" diff --git a/package.json b/package.json index cfb1ea24..60d1b006 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "prettier": "^2.6.2", "release-it": "^15.0.0", "robohydra": "^0.6.9", - "rollup": "^2.72.1", + "rollup": "^2.73.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-copy": "^3.4.0", "rollup-plugin-delete": "^2.0.0", diff --git a/src/charging-station/ui-server/AbstractUIServer.ts b/src/charging-station/ui-server/AbstractUIServer.ts index 2608e834..92860638 100644 --- a/src/charging-station/ui-server/AbstractUIServer.ts +++ b/src/charging-station/ui-server/AbstractUIServer.ts @@ -6,7 +6,7 @@ import { Server as WSServer } from 'ws'; export abstract class AbstractUIServer { public readonly chargingStations: Set; protected readonly uiServices: Map; - protected uiServer: WSServer | HttpServer; + protected server: WSServer | HttpServer; public constructor() { this.chargingStations = new Set(); diff --git a/src/charging-station/ui-server/UIWebSocketServer.ts b/src/charging-station/ui-server/UIWebSocketServer.ts index fcfc3097..f71f404b 100644 --- a/src/charging-station/ui-server/UIWebSocketServer.ts +++ b/src/charging-station/ui-server/UIWebSocketServer.ts @@ -12,11 +12,11 @@ import logger from '../../utils/Logger'; export default class UIWebSocketServer extends AbstractUIServer { public constructor(options?: ServerOptions) { super(); - this.uiServer = new Server(options ?? Configuration.getUIServer().options); + this.server = new Server(options ?? Configuration.getUIServer().options); } public start(): void { - this.uiServer.on('connection', (socket: WebSocket, request: IncomingMessage): void => { + this.server.on('connection', (socket: WebSocket, request: IncomingMessage): void => { const protocolIndex = socket.protocol.indexOf(Protocol.UI); const version = socket.protocol.substring( protocolIndex + Protocol.UI.length @@ -40,7 +40,7 @@ export default class UIWebSocketServer extends AbstractUIServer { } public stop(): void { - this.uiServer.close(); + this.server.close(); } public sendResponse(message: string): void { @@ -52,7 +52,7 @@ export default class UIWebSocketServer extends AbstractUIServer { } private broadcastToClients(message: string): void { - for (const client of (this.uiServer as Server).clients) { + for (const client of (this.server as Server).clients) { if (client?.readyState === OPEN) { client.send(message); } -- 2.34.1