MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / joinRouteSegments

Function joinRouteSegments

packages/astro/src/server/middleware.ts:413–419  ·  view source on GitHub ↗

* 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[][])

Source from the content-addressed store, hash-verified

411 * Function Reference: https://github.com/joanrieu/astro-typed-links/blob/b3dc12c6fe8d672a2bc2ae2ccc57c8071bbd09fa/package/src/integration.ts#L16
412 */
413function 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
421function getParametrizedRoute(
422 ctx: Parameters<MiddlewareResponseHandler>[0] & { routePattern?: string },

Callers 1

getParametrizedRouteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected