From 53ed3bdb9994c5360973765fb1f9d4b43ef7f972 Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Tue, 4 Dec 2018 16:04:17 +0100 Subject: [PATCH] fix: use symbol instead of constructor name (#292) --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 0095b8b117..affb1866e8 100644 --- a/src/index.js +++ b/src/index.js @@ -342,7 +342,7 @@ class Node extends EventEmitter { } if (t.filter(multiaddrs).length > 0) { - this._switch.transport.add(t.tag || t.constructor.name, t) + this._switch.transport.add(t.tag || t[Symbol.toStringTag], t) } else if (WebSockets.isWebSockets(t)) { // TODO find a cleaner way to signal that a transport is always used // for dialing, even if no listener