mirror of
https://github.com/amark/gun.git
synced 2026-03-13 11:55:07 +00:00
Set default options more robustly
This commit is contained in:
@@ -83,7 +83,8 @@ function Peer (url, options) {
|
||||
this.setMaxListeners(Infinity);
|
||||
|
||||
this.options = options || {};
|
||||
this.options.wsc = options.wsc || { protocols: null };
|
||||
if( !('wsc" in this.options ) ) this.options.wsc = options.wsc || { protocols: null };
|
||||
else if( !("protocols" in this.options.wsc) ) this.options.wsc.protocols = null;
|
||||
|
||||
// Messages sent before the socket is ready.
|
||||
this.deferredMsgs = [];
|
||||
|
||||
Reference in New Issue
Block a user