@@ -377,7 +377,6 @@ function baseParsePathname(pathname: string): ReadonlyArray<Segment> {
377377interface InterpolatePathOptions {
378378 path ?: string
379379 params : Record < string , unknown >
380- leaveWildcards ?: boolean
381380 leaveParams ?: boolean
382381 // Map of encoded chars to decoded chars (e.g. '%40' -> '@') that should remain decoded in path params
383382 decodeCharMap ?: Map < string , string >
@@ -403,7 +402,6 @@ type InterPolatePathResult = {
403402export function interpolatePath ( {
404403 path,
405404 params,
406- leaveWildcards,
407405 leaveParams,
408406 decodeCharMap,
409407 parseCache,
@@ -446,9 +444,6 @@ export function interpolatePath({
446444 if ( ! params . _splat ) {
447445 isMissingParams = true
448446 // For missing splat parameters, just return the prefix and suffix without the wildcard
449- if ( leaveWildcards ) {
450- return `${ segmentPrefix } ${ segment . value } ${ segmentSuffix } `
451- }
452447 // If there is a prefix or suffix, return them joined, otherwise omit the segment
453448 if ( segmentPrefix || segmentSuffix ) {
454449 return `${ segmentPrefix } ${ segmentSuffix } `
@@ -457,9 +452,6 @@ export function interpolatePath({
457452 }
458453
459454 const value = encodeParam ( '_splat' )
460- if ( leaveWildcards ) {
461- return `${ segmentPrefix } ${ segment . value } ${ value ?? '' } ${ segmentSuffix } `
462- }
463455 return `${ segmentPrefix } ${ value } ${ segmentSuffix } `
464456 }
465457
@@ -487,9 +479,6 @@ export function interpolatePath({
487479
488480 // Check if optional parameter is missing or undefined
489481 if ( ! ( key in params ) || params [ key ] == null ) {
490- if ( leaveWildcards ) {
491- return `${ segmentPrefix } ${ key } ${ segmentSuffix } `
492- }
493482 // For optional params with prefix/suffix, keep the prefix/suffix but omit the param
494483 if ( segmentPrefix || segmentSuffix ) {
495484 return `${ segmentPrefix } ${ segmentSuffix } `
@@ -504,9 +493,6 @@ export function interpolatePath({
504493 const value = encodeParam ( segment . value )
505494 return `${ segmentPrefix } ${ segment . value } ${ value ?? '' } ${ segmentSuffix } `
506495 }
507- if ( leaveWildcards ) {
508- return `${ segmentPrefix } ${ key } ${ encodeParam ( key ) ?? '' } ${ segmentSuffix } `
509- }
510496 return `${ segmentPrefix } ${ encodeParam ( key ) ?? '' } ${ segmentSuffix } `
511497 }
512498
0 commit comments