diff --git a/lib/client.ts b/lib/client.ts index 8216f5f61c..7262355175 100644 --- a/lib/client.ts +++ b/lib/client.ts @@ -29,7 +29,10 @@ export class Client< * @param conn * @package */ - constructor(server: Server, conn: Socket) { + constructor( + server: Server, + conn: Socket + ) { this.server = server; this.conn = conn; this.encoder = server.encoder; diff --git a/lib/index.ts b/lib/index.ts index 084c16e6b9..09fb0370e7 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -610,7 +610,7 @@ export class Server< */ public of( name: string | RegExp | ParentNspNameMatchFn, - fn?: (socket: Socket) => void + fn?: (socket: Socket) => void ): Namespace { if (typeof name === "function" || name instanceof RegExp) { const parentNsp = new ParentNamespace(this); diff --git a/lib/namespace.ts b/lib/namespace.ts index 1ab57c8e7e..6006529fb2 100644 --- a/lib/namespace.ts +++ b/lib/namespace.ts @@ -32,7 +32,10 @@ export class Namespace< /** @private */ _fns: Array< - (socket: Socket, next: (err?: ExtendedError) => void) => void + ( + socket: Socket, + next: (err?: ExtendedError) => void + ) => void > = []; /** @private */ @@ -69,7 +72,10 @@ export class Namespace< * @public */ public use( - fn: (socket: Socket, next: (err?: ExtendedError) => void) => void + fn: ( + socket: Socket, + next: (err?: ExtendedError) => void + ) => void ): this { this._fns.push(fn); return this; @@ -82,7 +88,10 @@ export class Namespace< * @param fn - last fn call in the middleware * @private */ - private run(socket: Socket, fn: (err: ExtendedError | null) => void) { + private run( + socket: Socket, + fn: (err: ExtendedError | null) => void + ) { const fns = this._fns.slice(0); if (!fns.length) return fn(null); @@ -151,7 +160,7 @@ export class Namespace< client: Client, query, fn?: () => void - ): Socket { + ): Socket { debug("adding socket to nsp %s", this.name); const socket = new Socket(this, client, query); this.run(socket, (err) => { @@ -194,7 +203,7 @@ export class Namespace< * * @private */ - _remove(socket: Socket): void { + _remove(socket: Socket): void { if (this.sockets.has(socket.id)) { this.sockets.delete(socket.id); } else {