Skip to content

Commit

Permalink
fix: avoid constructor.name pattern
Browse files Browse the repository at this point in the history
Replace constructor.name with instanceof. This is part of ongoing effort to properly
fix ipfs/js-ipfs#1131.
  • Loading branch information
ya7ya authored and vmx committed Mar 8, 2018
1 parent 1a81317 commit e386738
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ Multiaddr.protocols = protocols
*/
Multiaddr.isMultiaddr = function isMultiaddr (addr) {
if (addr.constructor && addr.constructor.name) {
return addr.constructor.name === 'Multiaddr'
return (addr instanceof Multiaddr)
}

return Boolean(
Expand Down

0 comments on commit e386738

Please sign in to comment.