Updating back component to Typescript 4.5

This commit is contained in:
David Négrier 2021-12-23 14:26:49 +01:00
parent 3daf7a402e
commit 220c9433d1
3 changed files with 15 additions and 6 deletions

View file

@ -75,7 +75,7 @@
"lint-staged": "^11.0.0",
"prettier": "^2.3.1",
"ts-node-dev": "^1.1.8",
"typescript": "^3.8.3"
"typescript": "^4.5.4"
},
"lint-staged": {
"*.ts": [

View file

@ -10,7 +10,16 @@ import {
import { UserSocket } from "_Model/User";
import { RoomSocket, ZoneSocket } from "../RoomManager";
export function emitError(Client: UserSocket, message: string): void {
export function emitError(Client: UserSocket, error: unknown): void {
let message = "";
if (error instanceof Error) {
message = error.message;
} else if (typeof error === "string") {
message = error;
} else {
message = "Unknown error";
}
const errorMessage = new ErrorMessage();
errorMessage.setMessage(message);

View file

@ -2900,10 +2900,10 @@ type-fest@^0.8.1:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==
typescript@^3.8.3:
version "3.9.7"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
typescript@^4.5.4:
version "4.5.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8"
integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==
uWebSockets.js@uNetworking/uWebSockets.js#v18.5.0:
version "18.5.0"