qs 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +12 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -81,7 +81,11 @@ var isint = /^[0-9]+$/;
|
|
|
81
81
|
function promote(parent, key) {
|
|
82
82
|
if (parent[key].length == 0) return parent[key] = createObject();
|
|
83
83
|
var t = createObject();
|
|
84
|
-
for (var i in parent[key])
|
|
84
|
+
for (var i in parent[key]) {
|
|
85
|
+
if (hasOwnProperty.call(parent[key], i)) {
|
|
86
|
+
t[i] = parent[key][i];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
85
89
|
parent[key] = t;
|
|
86
90
|
return t;
|
|
87
91
|
}
|
|
@@ -155,7 +159,13 @@ function compact(obj) {
|
|
|
155
159
|
|
|
156
160
|
if (isArray(obj)) {
|
|
157
161
|
var ret = [];
|
|
158
|
-
|
|
162
|
+
|
|
163
|
+
for (var i in obj) {
|
|
164
|
+
if (hasOwnProperty.call(obj, i)) {
|
|
165
|
+
ret.push(obj[i]);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
159
169
|
return ret;
|
|
160
170
|
}
|
|
161
171
|
|