refactor: make uris default to an empty array
This commit is contained in:
parent
1f391c15b1
commit
d84aa18174
|
@ -8,7 +8,7 @@ export abstract class BasePeer implements Peer {
|
||||||
challenge: Uint8Array;
|
challenge: Uint8Array;
|
||||||
protected _socket: any;
|
protected _socket: any;
|
||||||
|
|
||||||
constructor({ socket, uris }: PeerConstructorOptions) {
|
constructor({ socket, uris = [] }: PeerConstructorOptions) {
|
||||||
this.connectionUris = uris.map((uri) => new URL(uri.toString()));
|
this.connectionUris = uris.map((uri) => new URL(uri.toString()));
|
||||||
this.challenge = new Uint8Array();
|
this.challenge = new Uint8Array();
|
||||||
this._socket = socket;
|
this._socket = socket;
|
||||||
|
|
Loading…
Reference in New Issue