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 {
409409 /**
410410 * Function for decoding strings for params.
411411 */
412- decode ?: ( value : string , token : Key ) => string ;
412+ decode ?: ( value : string ) => string ;
413413}
414414
415415/**
@@ -424,11 +424,10 @@ export function regexpToFunction<P extends object = object>(
424424 const decoders = keys . map ( ( key ) => {
425425 if ( key . split ) {
426426 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 ) ;
429428 }
430429
431- return ( value : string , key : Key ) => decode ( value , key ) ;
430+ return decode ;
432431 } ) ;
433432
434433 return function match ( pathname : string ) {
@@ -443,7 +442,7 @@ export function regexpToFunction<P extends object = object>(
443442
444443 const key = keys [ i - 1 ] ;
445444 const decoder = decoders [ i - 1 ] ;
446- params [ key . name ] = decoder ( m [ i ] , key ) ;
445+ params [ key . name ] = decoder ( m [ i ] ) ;
447446 }
448447
449448 return { path, index, params } ;
You can’t perform that action at this time.
0 commit comments