Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
fix: remove use of assert module (#99)
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 authored Feb 14, 2020
1 parent d38edfb commit 29b8aa6
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
@@ -1,6 +1,5 @@
'use strict'

const assert = require('assert')
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
const multiaddr = require('multiaddr')
Expand All @@ -24,7 +23,9 @@ class Bootstrap extends EventEmitter {
*
*/
constructor (options = {}) {
assert(options.list && options.list.length, 'Bootstrap requires a list of peer addresses')
if (!options.list || !options.list.length) {
throw new Error('Bootstrap requires a list of peer addresses')
}
super()

this._list = options.list
Expand Down

0 comments on commit 29b8aa6

Please sign in to comment.