From 061e161c74dd817ae717c129da352d2a4a99de49 Mon Sep 17 00:00:00 2001 From: WarstekHUN Date: Tue, 20 Feb 2024 12:10:46 +0100 Subject: [PATCH] Type-handling improvement --- src/index.ts | 5 +++-- test/index.test.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 918155e..d62f03b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -173,7 +173,8 @@ export class ZilaServer { return this._status; } - private _clients: Array = []; + + private _clients: Array = []; public get clients() { return this._clients; @@ -312,7 +313,7 @@ export class ZilaServer { req.headers.cookie ? new Map(Object.entries(parseCookie(req.headers.cookie))) : new Map() ); - this._clients.push(zilaSocket); + this._clients.push(zilaSocket as T); if (this.serverEvents.onClientConnect) { for (const cb of this.serverEvents.onClientConnect) { diff --git a/test/index.test.ts b/test/index.test.ts index 49e0c20..4569d5f 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -29,7 +29,7 @@ class MyClient extends ZilaClient { describe("Non-Secure", () => { let client: ZilaConnection; let server: ZilaServer; - let clientSocket: ZilaClient; + let clientSocket: MyClient; beforeAll(async () => { server = new ZilaServer({