Travis build: 1892

This commit is contained in:
30secondsofcode
2020-04-16 20:04:29 +00:00
parent 5e42f0aaa4
commit 2cb8819913
9 changed files with 80 additions and 81 deletions

View File

@ -13,10 +13,10 @@ Return the `queryString` or an empty string when the `queryParameters` are falsy
const objectToQueryString = queryParameters => {
return queryParameters
? Object.entries(queryParameters).reduce((queryString, [key, val], index) => {
const symbol = queryString.length === 0 ? '?' : '&';
queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : '';
return queryString;
}, '')
const symbol = queryString.length === 0 ? '?' : '&';
queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : '';
return queryString;
}, '')
: '';
};
```