File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -409,7 +409,7 @@ export interface RegexpToFunctionOptions {
409
409
/**
410
410
* Function for decoding strings for params.
411
411
*/
412
- decode ?: ( value : string , token : Key ) => string ;
412
+ decode ?: ( value : string ) => string ;
413
413
}
414
414
415
415
/**
@@ -424,11 +424,10 @@ export function regexpToFunction<P extends object = object>(
424
424
const decoders = keys . map ( ( key ) => {
425
425
if ( key . split ) {
426
426
const splitRe = new RegExp ( key . split , "g" ) ;
427
- return ( value : string , key : Key ) =>
428
- value . split ( splitRe ) . map ( ( part ) => decode ( part , key ) ) ;
427
+ return ( value : string ) => value . split ( splitRe ) . map ( decode ) ;
429
428
}
430
429
431
- return ( value : string , key : Key ) => decode ( value , key ) ;
430
+ return decode ;
432
431
} ) ;
433
432
434
433
return function match ( pathname : string ) {
@@ -443,7 +442,7 @@ export function regexpToFunction<P extends object = object>(
443
442
444
443
const key = keys [ i - 1 ] ;
445
444
const decoder = decoders [ i - 1 ] ;
446
- params [ key . name ] = decoder ( m [ i ] , key ) ;
445
+ params [ key . name ] = decoder ( m [ i ] ) ;
447
446
}
448
447
449
448
return { path, index, params } ;
You can’t perform that action at this time.
0 commit comments