From 02051506fc7724db90d96392bfcefedda1b7330a Mon Sep 17 00:00:00 2001 From: Mick Lawitzke Date: Sat, 6 Feb 2021 10:17:24 +0100 Subject: [PATCH] Adapter should not use `typeof` Not sure why `typeof` was used but Adapter is a class and does not need a typeof. The problem is that it was not possible to have a function thats return type is an Adapter: ``` const createAdapter = (): Adapter => { ... }; server.adapter(createAdapter()); ``` --- lib/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/index.ts b/lib/index.ts index 149b0fedf8..b4f31bd16d 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -168,7 +168,7 @@ export class Server extends EventEmitter { */ _nsps: Map = new Map(); private parentNsps: Map = new Map(); - private _adapter?: typeof Adapter; + private _adapter?: Adapter; private _serveClient: boolean; private opts: Partial; private eio; @@ -315,10 +315,10 @@ export class Server extends EventEmitter { * @return self when setting or value when getting * @public */ - public adapter(): typeof Adapter | undefined; - public adapter(v: typeof Adapter): this; - public adapter(v?: typeof Adapter): typeof Adapter | undefined | this; - public adapter(v?: typeof Adapter): typeof Adapter | undefined | this { + public adapter(): Adapter | undefined; + public adapter(v: Adapter): this; + public adapter(v?: Adapter): Adapter | undefined | this; + public adapter(v?: Adapter): Adapter | undefined | this { if (!arguments.length) return this._adapter; this._adapter = v; for (const nsp of this._nsps.values()) {