* Join Astro route segments into a case-sensitive single path string. * * Astro lowercases the parametrized route. Joining segments manually is recommended to get the correct casing of the routes. * Recommendation in comment: https://github.com/withastro/astro/issues/13885#issuecomment-2934203029
(segments: RoutePart[][])
| 411 | * Function Reference: https://github.com/joanrieu/astro-typed-links/blob/b3dc12c6fe8d672a2bc2ae2ccc57c8071bbd09fa/package/src/integration.ts#L16 |
| 412 | */ |
| 413 | function joinRouteSegments(segments: RoutePart[][]): string { |
| 414 | const parthArray = segments.map(segment => |
| 415 | segment.map(routePart => (routePart.dynamic ? `[${routePart.content}]` : routePart.content)).join(''), |
| 416 | ); |
| 417 | |
| 418 | return `/${parthArray.join('/')}`; |
| 419 | } |
| 420 | |
| 421 | function getParametrizedRoute( |
| 422 | ctx: Parameters<MiddlewareResponseHandler>[0] & { routePattern?: string }, |
no outgoing calls
no test coverage detected