Skip to content

Commit

Permalink
[lint] Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Jun 24, 2017
1 parent 0434428 commit c311c43
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
42 changes: 20 additions & 22 deletions lib/PerMessageDeflate.js
Expand Up @@ -113,20 +113,17 @@ class PerMessageDeflate {
acceptAsServer (paramsList) {
const accepted = {};
const result = paramsList.some((params) => {
if ((
this._options.serverNoContextTakeover === false &&
params.server_no_context_takeover
) || (
this._options.serverMaxWindowBits === false &&
params.server_max_window_bits
) || (
typeof this._options.serverMaxWindowBits === 'number' &&
typeof params.server_max_window_bits === 'number' &&
this._options.serverMaxWindowBits > params.server_max_window_bits
) || (
typeof this._options.clientMaxWindowBits === 'number' &&
!params.client_max_window_bits
)) {
if (
(this._options.serverNoContextTakeover === false &&
params.server_no_context_takeover) ||
(this._options.serverMaxWindowBits === false &&
params.server_max_window_bits) ||
(typeof this._options.serverMaxWindowBits === 'number' &&
typeof params.server_max_window_bits === 'number' &&
this._options.serverMaxWindowBits > params.server_max_window_bits) ||
(typeof this._options.clientMaxWindowBits === 'number' &&
!params.client_max_window_bits)
) {
return;
}

Expand All @@ -136,10 +133,11 @@ class PerMessageDeflate {
) {
accepted.server_no_context_takeover = true;
}
if (this._options.clientNoContextTakeover || (
this._options.clientNoContextTakeover !== false &&
params.client_no_context_takeover
)) {
if (
this._options.clientNoContextTakeover ||
(this._options.clientNoContextTakeover !== false &&
params.client_no_context_takeover)
) {
accepted.client_no_context_takeover = true;
}
if (typeof this._options.serverMaxWindowBits === 'number') {
Expand Down Expand Up @@ -189,10 +187,10 @@ class PerMessageDeflate {
throw new Error('Invalid value for "client_max_window_bits"');
}
if (
typeof this._options.clientMaxWindowBits === 'number' && (
!params.client_max_window_bits ||
params.client_max_window_bits > this._options.clientMaxWindowBits
)) {
typeof this._options.clientMaxWindowBits === 'number' &&
(!params.client_max_window_bits ||
params.client_max_window_bits > this._options.clientMaxWindowBits)
) {
throw new Error('Invalid value for "client_max_window_bits"');
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Validation.js
Expand Up @@ -10,7 +10,7 @@ try {
const isValidUTF8 = require('utf-8-validate');

module.exports = typeof isValidUTF8 === 'object'
? isValidUTF8.Validation.isValidUTF8 // utf-8-validate@<3.0.0
? isValidUTF8.Validation.isValidUTF8 // utf-8-validate@<3.0.0
: isValidUTF8;
} catch (e) /* istanbul ignore next */ {
module.exports = () => true;
Expand Down

0 comments on commit c311c43

Please sign in to comment.