permessage-deflate
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -0,1 +1,5 @@ | ||
### 0.1.2 / 2014-12-18 | ||
* Don't allow configure() to be called with unrecognized options | ||
### 0.1.1 / 2014-12-15 | ||
@@ -2,0 +6,0 @@ |
@@ -32,2 +32,9 @@ 'use strict'; | ||
validateOptions: function(options, validKeys) { | ||
for (var key in options) { | ||
if (validKeys.indexOf(key) < 0) | ||
throw new Error('Unrecognized option: ' + key); | ||
} | ||
}, | ||
validParams: function(params) { | ||
@@ -34,0 +41,0 @@ var keys = Object.keys(params), i = keys.length; |
'use strict'; | ||
var ClientSession = require('./client_session'), | ||
ServerSession = require('./server_session'); | ||
ServerSession = require('./server_session'), | ||
common = require('./common'); | ||
var VALID_OPTIONS = [ | ||
'level', | ||
'memLevel', | ||
'strategy', | ||
'noContextTakeover', | ||
'maxWindowBits', | ||
'requestNoContextTakeover', | ||
'requestMaxWindowBits' | ||
]; | ||
var PermessageDeflate = { | ||
configure: function(options) { | ||
common.validateOptions(options, VALID_OPTIONS); | ||
var opts = this._options || {}; | ||
@@ -9,0 +21,0 @@ for (var key in opts) options[key] = opts[key]; |
@@ -8,3 +8,3 @@ { "name" : "permessage-deflate" | ||
, "version" : "0.1.1" | ||
, "version" : "0.1.2" | ||
, "engines" : {"node": ">=0.6.0"} | ||
@@ -11,0 +11,0 @@ , "main" : "./lib/permessage_deflate" |
16411
306