Comparing version 0.6.2 to 0.6.3
22
index.js
@@ -145,3 +145,3 @@ | ||
/** | ||
* Compact sparse arrays | ||
* Compact sparse arrays. | ||
*/ | ||
@@ -165,3 +165,20 @@ | ||
/** | ||
* Restore Object.prototype. | ||
* see pull-request #58 | ||
*/ | ||
function restoreProto(obj) { | ||
if (!Object.create) return obj; | ||
if (isArray(obj)) return obj; | ||
if (obj && 'object' != typeof obj) return obj; | ||
for (var key in obj) { | ||
obj[key] = restoreProto(obj[key]); | ||
} | ||
obj.__proto__ = Object.prototype; | ||
return obj; | ||
} | ||
/** | ||
@@ -173,2 +190,3 @@ * Parse the given obj. | ||
var ret = { base: {} }; | ||
forEach(objectKeys(obj), function(name){ | ||
@@ -200,3 +218,3 @@ merge(ret, name, obj[name]); | ||
return compact(ret); | ||
return restoreProto(compact(ret)); | ||
} | ||
@@ -203,0 +221,0 @@ |
{ | ||
"name": "qs", | ||
"description": "querystring parser", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"keywords": ["query string", "parser", "component"], | ||
@@ -17,7 +17,2 @@ "repository": { | ||
}, | ||
"component": { | ||
"scripts": { | ||
"querystring": "querystring.js" | ||
} | ||
}, | ||
"author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)", | ||
@@ -24,0 +19,0 @@ "main": "index", |
10142
313