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

Commit

Permalink
fix: remove use of assert module (#101)
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 14, 2020
1 parent c8fda16 commit 89d3723
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 @@ -7,7 +7,6 @@ const toUri = require('multiaddr-to-uri')
const { AbortError } = require('abortable-iterator')

const log = require('debug')('libp2p:websockets')
const assert = require('assert')

const createListener = require('./listener')
const toConnection = require('./socket-to-conn')
Expand All @@ -23,7 +22,9 @@ class WebSockets {
* @param {Upgrader} options.upgrader
*/
constructor ({ upgrader }) {
assert(upgrader, 'An upgrader must be provided. See https://github.com/libp2p/interface-transport#upgrader.')
if (!upgrader) {
throw new Error('An upgrader must be provided. See https://github.com/libp2p/interface-transport#upgrader.')
}
this._upgrader = upgrader
}

Expand Down

0 comments on commit 89d3723

Please sign in to comment.