Comparing version 0.6.0 to 0.6.1
18
index.js
@@ -61,2 +61,12 @@ | ||
/** | ||
* Create a nullary object if possible | ||
*/ | ||
function createObject() { | ||
return Object.create | ||
? Object.create(null) | ||
: {}; | ||
} | ||
/** | ||
* Cache non-integer test regexp. | ||
@@ -68,4 +78,4 @@ */ | ||
function promote(parent, key) { | ||
if (parent[key].length == 0) return parent[key] = {}; | ||
var t = {}; | ||
if (parent[key].length == 0) return parent[key] = createObject(); | ||
var t = createObject(); | ||
for (var i in parent[key]) t[i] = parent[key][i]; | ||
@@ -126,3 +136,3 @@ parent[key] = t; | ||
if (!isint.test(key) && isArray(parent.base)) { | ||
var t = {}; | ||
var t = createObject(); | ||
for (var k in parent.base) t[k] = parent.base[k]; | ||
@@ -166,3 +176,3 @@ parent.base = t; | ||
return merge(ret, decode(key), decode(val)); | ||
}, { base: {} }).base; | ||
}, { base: createObject() }).base; | ||
} | ||
@@ -169,0 +179,0 @@ |
{ | ||
"name": "qs", | ||
"description": "querystring parser", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"keywords": ["query string", "parser", "component"], | ||
@@ -6,0 +6,0 @@ "repository": { |
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
9559
283
0