Skip to content

Commit 22937f3

Browse files
ya7yadryajov
authored andcommitted
fix: avoid constructor.name pattern
Replace constructor.name with instanceof. This is part of ongoing effort to properly fix ipfs/js-ipfs#1131.
1 parent c992dce commit 22937f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ Multiaddr.protocols = protocols
415415
*/
416416
Multiaddr.isMultiaddr = function isMultiaddr (addr) {
417417
if (addr.constructor && addr.constructor.name) {
418-
return addr.constructor.name === 'Multiaddr'
418+
return (addr instanceof Multiaddr)
419419
}
420420

421421
return Boolean(

0 commit comments

Comments
 (0)