Skip to content

Commit

Permalink
feat: use class-is for type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
fsdiogo authored and daviddias committed Apr 5, 2018
1 parent 141920c commit bb0c990
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const series = require('async/series')
const PeerBook = require('peer-book')
const Switch = require('libp2p-switch')
const Ping = require('libp2p-ping')
const WebSockets = require('libp2p-websockets')

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

0 comments on commit bb0c990

Please sign in to comment.