Skip to content

Commit

Permalink
move two value combine to a utils function
Browse files Browse the repository at this point in the history
  • Loading branch information
elidoran committed Dec 22, 2016
1 parent de0863a commit 50080b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var parseValues = function parseQueryStringValues(str, options) {
val = options.decoder(part.slice(pos + 1));
}
if (has.call(obj, key)) {
obj[key] = [].concat(obj[key]).concat(val);
obj[key] = utils.combine(obj[key], val);
} else {
obj[key] = val;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,7 @@ exports.isBuffer = function (obj) {

return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
};

exports.combine = function (a, b) {
return [].concat(a).concat(b);
};

0 comments on commit 50080b6

Please sign in to comment.