Skip to content

Commit 80ca3dc

Browse files
committed
feat: use class-is for type checks
1 parent 2dc94cd commit 80ca3dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const series = require('async/series')
1010
const PeerBook = require('peer-book')
1111
const Switch = require('libp2p-switch')
1212
const Ping = require('libp2p-ping')
13+
const WebSockets = require('libp2p-websockets')
1314

1415
const peerRouting = require('./peer-routing')
1516
const contentRouting = require('./content-routing')
@@ -129,8 +130,7 @@ class Node extends EventEmitter {
129130
if (transport.filter(multiaddrs).length > 0) {
130131
this.switch.transport.add(
131132
transport.tag || transport.constructor.name, transport)
132-
} else if (transport.constructor &&
133-
transport.constructor.name === 'WebSockets') {
133+
} else if (WebSockets.isWebSockets(transport)) {
134134
// TODO find a cleaner way to signal that a transport is always
135135
// used for dialing, even if no listener
136136
ws = transport

0 commit comments

Comments
 (0)