From aead83560dfdcb83c70d87061875c45aae9d1bd6 Mon Sep 17 00:00:00 2001 From: Samuel Vogelsanger Date: Wed, 23 Oct 2024 10:59:23 +0200 Subject: [PATCH] refactor(sio): make Namespace._fns private (#5196) Related: https://github.com/socketio/socket.io/issues/5179 --- packages/socket.io/lib/namespace.ts | 2 +- packages/socket.io/lib/parent-namespace.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/socket.io/lib/namespace.ts b/packages/socket.io/lib/namespace.ts index d7ae1308fe..8fd306b9f5 100644 --- a/packages/socket.io/lib/namespace.ts +++ b/packages/socket.io/lib/namespace.ts @@ -161,7 +161,7 @@ export class Namespace< SocketData >; - protected _fns: Array< + private _fns: Array< ( socket: Socket, next: (err?: ExtendedError) => void, diff --git a/packages/socket.io/lib/parent-namespace.ts b/packages/socket.io/lib/parent-namespace.ts index 6139b8e969..d3468bf46f 100644 --- a/packages/socket.io/lib/parent-namespace.ts +++ b/packages/socket.io/lib/parent-namespace.ts @@ -67,7 +67,7 @@ export class ParentNamespace< ): Namespace { debug("creating child namespace %s", name); const namespace = new Namespace(this.server, name); - this._fns.forEach((fn) => namespace.use(fn)); + this["_fns"].forEach((fn) => namespace.use(fn)); this.listeners("connect").forEach((listener) => namespace.on("connect", listener), );