Skip to content

Commit e20d487

Browse files
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: socketio/socket.io#3726
1 parent 34f822f commit e20d487

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,6 @@ exports.connect = lookup;
100100
*/
101101

102102
export { Manager, ManagerOptions } from "./manager";
103-
export { lookup as io, Socket, SocketOptions };
103+
export { Socket } from "./socket";
104+
export { lookup as io, SocketOptions };
104105
export default lookup;

wrapper.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import io from "./build/index.js";
22

33
export const Manager = io.Manager;
4+
export const Socket = io.Socket;
45
export { io };
56
export default io;

0 commit comments

Comments
 (0)