From e20d487ac080910c90e7b766f8509f5e40c9ecfe Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Thu, 6 May 2021 11:22:56 +0200 Subject: [PATCH] fix: properly export the Socket class Before this change, `require("socket.io-client").Socket` would return "undefined". Note: having access to the Socket class allows users to modify its prototype. Related: https://github.com/socketio/socket.io/issues/3726 --- lib/index.ts | 3 ++- wrapper.mjs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/index.ts b/lib/index.ts index 9269758d4..903b78a5e 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -100,5 +100,6 @@ exports.connect = lookup; */ export { Manager, ManagerOptions } from "./manager"; -export { lookup as io, Socket, SocketOptions }; +export { Socket } from "./socket"; +export { lookup as io, SocketOptions }; export default lookup; diff --git a/wrapper.mjs b/wrapper.mjs index 7433e4780..3853094bd 100644 --- a/wrapper.mjs +++ b/wrapper.mjs @@ -1,5 +1,6 @@ import io from "./build/index.js"; export const Manager = io.Manager; +export const Socket = io.Socket; export { io }; export default io;