Comparing version 0.5.0 to 0.5.1
0.5.1 / 2012-09-18 | ||
================== | ||
* fix encoded `=`. Closes #43 | ||
0.5.0 / 2012-05-04 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -102,8 +102,2 @@ | ||
.reduce(function(ret, pair){ | ||
try{ | ||
pair = decodeURIComponent(pair.replace(/\+/g, ' ')); | ||
} catch(e) { | ||
// ignore | ||
} | ||
var eql = pair.indexOf('=') | ||
@@ -118,3 +112,3 @@ , brace = lastBraceInKey(pair) | ||
return merge(ret, key, val); | ||
return merge(ret, decode(key), decode(val)); | ||
}, { base: {} }).base; | ||
@@ -255,1 +249,17 @@ } | ||
} | ||
/** | ||
* Decode `str`. | ||
* | ||
* @param {String} str | ||
* @return {String} | ||
* @api private | ||
*/ | ||
function decode(str) { | ||
try { | ||
return decodeURIComponent(str.replace(/\+/g, ' ')); | ||
} catch (err) { | ||
return str; | ||
} | ||
} |
{ | ||
"name": "qs", | ||
"description": "querystring parser", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"keywords": ["query string", "parser", "component"], | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -31,5 +31,2 @@ | ||
expect(qs.parse('foo%3Dbar=baz')) | ||
.to.eql({ foo: 'bar=baz' }); | ||
expect(qs.parse(' foo = bar = baz ')) | ||
@@ -56,2 +53,7 @@ .to.eql({ ' foo ': ' bar = baz ' }); | ||
it('should support encoded = signs', function(){ | ||
expect(qs.parse('he%3Dllo=th%3Dere')) | ||
.to.eql({ 'he=llo': 'th=ere' }); | ||
}) | ||
it('should support nesting', function(){ | ||
@@ -58,0 +60,0 @@ expect(qs.parse('ops[>=]=25')) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
387284
24
12811
0