Fixes some bool options (#521)

* Fix boolean options

* viewlad

* grunt
This commit is contained in:
Hugo Holmqvist
2016-08-16 19:50:27 +03:00
committed by abal
parent 89bbf5d6be
commit e42178181d
2 changed files with 4 additions and 4 deletions

View File

@@ -71,8 +71,8 @@ var Client = (function (_EventEmitter) {
* @type {ClientOptions} * @type {ClientOptions}
*/ */
this.options = options || {}; this.options = options || {};
this.options.compress = options.compress || !process.browser; this.options.compress = options.compress === undefined ? !process.browser : options.compress;
this.options.autoReconnect = options.autoReconnect || true; this.options.autoReconnect = options.autoReconnect === undefined ? true : options.autoReconnect;
this.options.rateLimitAsError = options.rateLimitAsError || false; this.options.rateLimitAsError = options.rateLimitAsError || false;
this.options.largeThreshold = options.largeThreshold || 250; this.options.largeThreshold = options.largeThreshold || 250;
this.options.maxCachedMessages = options.maxCachedMessages || 1000; this.options.maxCachedMessages = options.maxCachedMessages || 1000;

View File

@@ -45,8 +45,8 @@ export default class Client extends EventEmitter {
* @type {ClientOptions} * @type {ClientOptions}
*/ */
this.options = options || {}; this.options = options || {};
this.options.compress = options.compress || (!process.browser); this.options.compress = options.compress === undefined ? !process.browser : options.compress;
this.options.autoReconnect = options.autoReconnect || true; this.options.autoReconnect = options.autoReconnect === undefined ? true : options.autoReconnect;
this.options.rateLimitAsError = options.rateLimitAsError || false; this.options.rateLimitAsError = options.rateLimitAsError || false;
this.options.largeThreshold = options.largeThreshold || 250; this.options.largeThreshold = options.largeThreshold || 250;
this.options.maxCachedMessages = options.maxCachedMessages || 1000; this.options.maxCachedMessages = options.maxCachedMessages || 1000;