in api/VsoClient.ts [187:213]
private queryParamsToStringHelper(queryParams: any, prefix: string): string {
if (!queryParams) {
return '';
}
let queryString: string = '';
if (typeof(queryParams) !== 'string') {
for (let property in queryParams) {
if (queryParams.hasOwnProperty(property)) {
const prop = queryParams[property];
const newPrefix = prefix + encodeURIComponent(property.toString()) + '.';
queryString += this.queryParamsToStringHelper(prop, newPrefix);
}
}
}
if (queryString === '' && prefix.length > 0){
// Date.prototype.toString() returns a string that is not valid for the REST API.
// Need to specially call `toUTCString()` instead for such cases
const queryValue = typeof queryParams === 'object' && 'toUTCString' in queryParams ? (queryParams as Date).toUTCString() : queryParams.toString();
// Will always need to chop period off of end of prefix
queryString = prefix.slice(0,-1) + '=' + encodeURIComponent(queryValue) + '&';
}
return queryString;
}