Skip to content

Commit

Permalink
fix: properly export the Socket class
Browse files Browse the repository at this point in the history
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
  • Loading branch information
darrachequesne committed May 6, 2021
1 parent 34f822f commit e20d487
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
1 change: 1 addition & 0 deletions wrapper.mjs
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit e20d487

Please sign in to comment.