File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -423,22 +423,26 @@ function queryToSearchParams(
423
423
init ?:
424
424
| URLSearchParams
425
425
| string
426
- | Record < string , string | readonly string [ ] >
427
- | Iterable < [ string , string ] >
428
- | ReadonlyArray < [ string , string ] >
426
+ | Record < string , any >
427
+ | Iterable < [ string , any ] >
428
+ | ReadonlyArray < [ string , any ] >
429
429
| null
430
430
| undefined
431
431
) : URLSearchParams {
432
432
const params = new URLSearchParams ( init ?? '' )
433
- const normalized : Record < string , string > = { }
434
- for ( const entry of params . entries ( ) ) {
433
+ const normalized = { __proto__ : null } as unknown as Record < string , string >
434
+ const entries : Iterable < [ string , any ] > = params . entries ( )
435
+ for ( const entry of entries ) {
435
436
let key = entry [ 0 ]
437
+ const value = entry [ 1 ]
436
438
if ( key === 'defaultBranch' ) {
437
439
key = 'default_branch'
438
440
} else if ( key === 'perPage' ) {
439
441
key = 'per_page'
440
442
}
441
- normalized [ key ] = entry [ 1 ]
443
+ if ( value || value === 0 ) {
444
+ normalized [ key ] = value
445
+ }
442
446
}
443
447
return new URLSearchParams ( normalized )
444
448
}
You can’t perform that action at this time.
0 commit comments