Skip to content

Commit f0aae84

Browse files
fix: restore the default export
The default export was accidentally removed in [1]. Note: that being said, users are encouraged to use the named exports, because the default export has a different meaning for CommonJS and ES modules users. ```js // BAD import io from "socket.io-client"; // GOOD import { io } from "socket.io-client"; ``` Related: - #1505 - #1507 - #1508 [1]: 16b6569
1 parent 8737d0a commit f0aae84

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ Object.assign(lookup, {
8080
connect: lookup,
8181
});
8282

83+
if (typeof module !== "undefined") {
84+
module.exports = lookup;
85+
}
86+
8387
/**
8488
* Protocol version.
8589
*
@@ -101,4 +105,5 @@ export {
101105
SocketOptions,
102106
lookup as io,
103107
lookup as connect,
108+
lookup as default,
104109
};

0 commit comments

Comments
 (0)