(routes: AgnosticRouteObject[], url: URL)
| 119 | * Get transaction name from routes and url |
| 120 | */ |
| 121 | export function getTransactionName(routes: AgnosticRouteObject[], url: URL): [string, TransactionSource] { |
| 122 | const matches = matchServerRoutes(routes, url.pathname); |
| 123 | const match = matches && getRequestMatch(url, matches); |
| 124 | |
| 125 | if (match === null) { |
| 126 | return [url.pathname, 'url']; |
| 127 | } |
| 128 | |
| 129 | const routeId = match.route.id || 'no-route-id'; |
| 130 | |
| 131 | // Convert route ID to parameterized path (e.g., "routes/users.$id" -> "/users/:id") |
| 132 | // This is a pure string transformation that works without the Vite plugin manifest |
| 133 | const parameterizedPath = convertRemixRouteIdToPath(routeId); |
| 134 | return [parameterizedPath, 'route']; |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * Creates routes from the server route manifest |
no test coverage detected