Skip to content

Commit

Permalink
[major] Drop support for the memLevel and level options
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Jul 7, 2018
1 parent 92d0a2e commit 80e2002
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
10 changes: 1 addition & 9 deletions lib/permessage-deflate.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,7 @@ class PerMessageDeflate {
: this.params[key];

this._deflate = zlib.createDeflateRaw(
Object.assign(
// TODO deprecate memLevel/level and recommend zlibDeflateOptions instead
{
memLevel: this._options.memLevel,
level: this._options.level
},
this._options.zlibDeflateOptions,
{ windowBits }
)
Object.assign({}, this._options.zlibDeflateOptions, { windowBits })
);

this._deflate[kTotalLength] = 0;
Expand Down
13 changes: 10 additions & 3 deletions test/permessage-deflate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,14 @@ describe('PerMessageDeflate', function () {
});

it('honors the `level` option', function (done) {
const lev0 = new PerMessageDeflate({ threshold: 0, level: 0 });
const lev9 = new PerMessageDeflate({ threshold: 0, level: 9 });
const lev0 = new PerMessageDeflate({
threshold: 0,
zlibDeflateOptions: { level: 0 }
});
const lev9 = new PerMessageDeflate({
threshold: 0,
zlibDeflateOptions: { level: 9 }
});
const extensionStr = (
'permessage-deflate; server_no_context_takeover; ' +
'client_no_context_takeover; server_max_window_bits=10; ' +
Expand Down Expand Up @@ -409,7 +415,8 @@ describe('PerMessageDeflate', function () {
}
});

// Note no context takeover so we can get a hold of the raw streams after we do the dance
// Note no context takeover so we can get a hold of the raw streams after
// we do the dance.
const extensionStr = (
'permessage-deflate; server_max_window_bits=10; ' +
'client_max_window_bits=11'
Expand Down

0 comments on commit 80e2002

Please sign in to comment.