File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ function getWS(): Promise<typeof WS> {
77 if ( process . env . ES_TARGET == 'esm' ) {
88 return import ( 'ws' )
99 } else {
10- // eslint-disable-next-line
11- return new Promise ( resolve => resolve ( require ( 'ws' ) ) )
10+ return new Promise ( resolve => resolve ( require ( 'ws' ) ) ) // eslint-disable-line
1211 }
1312}
1413
@@ -47,7 +46,8 @@ export class WebSocketWrapper extends Listener {
4746 this . _connectionTimeout . clear ( )
4847 if ( isNodeJS ( ) ) {
4948 // NodeJS module
50- getWS ( ) . then ( WebSocketClient => {
49+ getWS ( ) . then ( ws => {
50+ const WebSocketClient = ( ( ws as any ) . default as typeof WS ) || ws
5151 this . ws = new WebSocketClient ( this . url )
5252 this . ws . on ( 'open' , ( ) => {
5353 this . _status = true
@@ -124,4 +124,4 @@ export class WebSocketWrapper extends Listener {
124124 this . _tryReconnect = false
125125 this . ws && this . ws . close ( )
126126 }
127- }
127+ }
You can’t perform that action at this time.
0 commit comments