Skip to content

Commit

Permalink
Avoid converting array to object
Browse files Browse the repository at this point in the history
  • Loading branch information
JMPerez committed Mar 15, 2018
1 parent 133586a commit 66f9848
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/base-request.js
Expand Up @@ -128,6 +128,9 @@ Builder.prototype.withAuth = function(accessToken) {
};

Builder.prototype._assign = function(src, obj) {
if (obj && Array.isArray(obj)) {
return Object.assign(src || [], obj);
}
if (obj && Object.keys(obj).length > 0) {
return Object.assign(src || {}, obj);
}
Expand Down

0 comments on commit 66f9848

Please sign in to comment.