Skip to content

Commit

Permalink
Merge pull request #84 from caseywebdev/patch-1
Browse files Browse the repository at this point in the history
Fix `t` query parameter for `build` command
  • Loading branch information
apocas authored Aug 28, 2017
2 parents 2d0d03f + 8565c3f commit 94161fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/modem.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ Modem.prototype.buildQuerystring = function(opts) {

// serialize map values as JSON strings, else querystring truncates.
Object.keys(opts).map(function(key, i) {
clone[key] = (opts[key] && typeof opts[key] === 'object') ?
clone[key] = (opts[key] && typeof opts[key] === 'object' && key !== 't') ?
JSON.stringify(opts[key]) : opts[key];
});

Expand Down
5 changes: 3 additions & 2 deletions test/modem_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ describe('Modem', function () {
"limit": 12,
"filters": {
"label": ["staging", "env=green"]
}
},
"t": ["repo:latest", "repo:1.0.0"]
}
var control = 'limit=12&filters={"label"%3A["staging"%2C"env%3Dgreen"]}'
var control = 'limit=12&filters={"label"%3A["staging"%2C"env%3Dgreen"]}&t=repo%3Alatest&t=repo%3A1.0.0'
var qs = modem.buildQuerystring(opts);
assert.strictEqual(decodeURI(qs), control);
});
Expand Down

0 comments on commit 94161fb

Please sign in to comment.