From 1ecc94b887d23ac59b3622a2fefc9fdab24f170f Mon Sep 17 00:00:00 2001 From: Jonas Gloning <34194370+jonasgloning@users.noreply.github.com> Date: Tue, 10 Jan 2023 21:16:48 +0100 Subject: [PATCH] fix(deps): update dependency ws to v8 --- package-lock.json | 32 +++++++++++++-------------- package.json | 4 ++-- src/services/webSocketServer/index.ts | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7ae445829..22712b31e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "cors": "^2.8.5", "express": "^4.17.1", - "ws": "^7.2.3", + "ws": "^7.2.3 || ^8.0.0", "yargs": "^17.6.2" }, "bin": { @@ -28,7 +28,7 @@ "@types/express": "^4.17.3", "@types/mocha": "^10.0.0", "@types/node": "^14.18.33", - "@types/ws": "^7.2.3", + "@types/ws": "^7.2.3 || ^8.0.0", "@types/yargs": "^17.0.19", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", @@ -2950,9 +2950,9 @@ } }, "node_modules/@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", "dev": true, "dependencies": { "@types/node": "*" @@ -12592,15 +12592,15 @@ } }, "node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz", + "integrity": "sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==", "engines": { - "node": ">=8.3.0" + "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -14829,9 +14829,9 @@ } }, "@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", "dev": true, "requires": { "@types/node": "*" @@ -21812,9 +21812,9 @@ } }, "ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz", + "integrity": "sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==", "requires": {} }, "xtend": { diff --git a/package.json b/package.json index a071cb1aa..62852de6f 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "dependencies": { "cors": "^2.8.5", "express": "^4.17.1", - "ws": "^7.2.3", + "ws": "^7.2.3 || ^8.0.0", "yargs": "^17.6.2" }, "devDependencies": { @@ -75,7 +75,7 @@ "@types/express": "^4.17.3", "@types/mocha": "^10.0.0", "@types/node": "^14.18.33", - "@types/ws": "^7.2.3", + "@types/ws": "^7.2.3 || ^8.0.0", "@types/yargs": "^17.0.19", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", diff --git a/src/services/webSocketServer/index.ts b/src/services/webSocketServer/index.ts index c9201267b..4fbcdb1a8 100644 --- a/src/services/webSocketServer/index.ts +++ b/src/services/webSocketServer/index.ts @@ -130,9 +130,9 @@ export class WebSocketServer extends EventEmitter implements IWebSocketServer { }); // Handle messages from peers. - socket.on("message", (data: WebSocketLib.Data) => { + socket.on("message", (data) => { try { - const message = JSON.parse(data as string); + const message = JSON.parse(data.toString()); message.src = client.getId();