Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
fix: remove use of assert module (#88)
Browse files Browse the repository at this point in the history
The polyfill is big, we can simulate it by throwing an Error and
it doesn't work under React Native.
  • Loading branch information
achingbrain committed Feb 13, 2020
1 parent ac8c640 commit a0613c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
const PeerId = require('peer-id')
const { ensureMultiaddr } = require('./utils')
const MultiaddrSet = require('./multiaddr-set')
const assert = require('assert')

// Peer represents a peer on the IPFS network
class PeerInfo {
constructor (peerId) {
assert(peerId, 'Missing peerId. Use Peer.create() to create one')
if (!peerId) {
throw new Error('Missing peerId. Use Peer.create() to create one')
}

this.id = peerId
this.multiaddrs = new MultiaddrSet()
Expand Down

0 comments on commit a0613c5

Please sign in to comment.