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

Commit 29b8aa6

Browse files
authored
fix: remove use of assert module (#99)
The polyfill is big, we can simulate it by throwing an Error and it doesn't work under React Native.
1 parent d38edfb commit 29b8aa6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict'
22

3-
const assert = require('assert')
43
const PeerId = require('peer-id')
54
const PeerInfo = require('peer-info')
65
const multiaddr = require('multiaddr')
@@ -24,7 +23,9 @@ class Bootstrap extends EventEmitter {
2423
*
2524
*/
2625
constructor (options = {}) {
27-
assert(options.list && options.list.length, 'Bootstrap requires a list of peer addresses')
26+
if (!options.list || !options.list.length) {
27+
throw new Error('Bootstrap requires a list of peer addresses')
28+
}
2829
super()
2930

3031
this._list = options.list

0 commit comments

Comments
 (0)