(ctx, next)
| 13 | * `/src/middleware.js` file. |
| 14 | */ |
| 15 | export const onRequest: MiddlewareHandler = (ctx, next) => { |
| 16 | const middleware = handleRequest(); |
| 17 | |
| 18 | // `onRequest` deliberately uses framework-agnostic parameter types so the published |
| 19 | // `@sentry/astro/middleware` declaration does not reference Astro-version-specific types |
| 20 | // (e.g. `MiddlewareResponseHandler`, which is absent in some supported Astro versions). |
| 21 | // The handler returned by `handleRequest()` is typed against Astro's own types, so we cast |
| 22 | // back to its expected parameter types here – the runtime shapes are identical. |
| 23 | return middleware(ctx as Parameters<typeof middleware>[0], next as Parameters<typeof middleware>[1]); |
| 24 | }; |
no test coverage detected