We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5316d63 commit 2182cfeCopy full SHA for 2182cfe
src/templates/client.mustache
@@ -49,15 +49,10 @@ export class Api{{apiConfig.generic}} {
49
}
50
51
{{#hasQueryRoutes}}
52
- private addQueryParams(query: object): string {
+ private addQueryParams(query: {[key:string]:string|number|boolean}): string {
53
const keys = Object.keys(query);
54
- return keys.length ? (
55
- '?' +
56
- keys.reduce((paramsArray, param) => [
57
- ...paramsArray,
58
- param + '=' + encodeURIComponent(query[param])
59
- ], []).join('&')
60
- ) : ''
+ return keys.length === 0 ? ''
+ : '?' + keys.map(key => encodeURIComponent(key) + '=' + encodeURIComponent(query[key])).join('&')
61
62
{{/hasQueryRoutes}}
63
0 commit comments