File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -418,18 +418,19 @@ export class UrlMatcher {
418
418
return acc + encodeURIComponent ( < string > encoded ) ;
419
419
} , "" ) ;
420
420
421
- // Build the query string by
421
+ // Build the query string by applying parameter values (array or regular)
422
+ // then mapping to key=value, then flattening and joining using "&"
422
423
let queryString = queryParams . map ( ( param : Param ) => {
423
424
let { squash, encoded, isDefaultValue} = getDetails ( param ) ;
424
425
if ( encoded == null || ( isDefaultValue && squash !== false ) ) return ;
425
426
if ( ! isArray ( encoded ) ) encoded = [ < string > encoded ] ;
426
427
if ( encoded . length === 0 ) return ;
427
428
if ( ! param . type . raw ) encoded = map ( < string [ ] > encoded , encodeURIComponent ) ;
428
429
429
- return encoded . map ( val => `${ param . id } =${ val } ` ) ;
430
+ return ( < string [ ] > encoded ) . map ( val => `${ param . id } =${ val } ` ) ;
430
431
} ) . filter ( identity ) . reduce ( unnestR , [ ] ) . join ( "&" ) ;
431
432
432
- // Concat the pathstring with the queryString (if exists) and the hasString (if exists)
433
+ // Concat the pathstring with the queryString (if exists) and the hashString (if exists)
433
434
return pathString + ( queryString ? `?${ queryString } ` : "" ) + ( values [ "#" ] ? "#" + values [ "#" ] : "" ) ;
434
435
}
435
436
You can’t perform that action at this time.
0 commit comments