| 1 | /** |
| 2 | * Accessor for the web-standard request behind a Deno HTTP server request. |
| 3 | * |
| 4 | * Unlike Bun's accessor, this function has no route-pattern generic because |
| 5 | * `Deno.serve` always receives a standard `Request`. Connection information is |
| 6 | * intentionally kept internal to `DenoHttpServer`. |
| 7 | * |
| 8 | * @since 4.0.0 |
| 9 | */ |
| 10 | import type { HttpServerRequest } from "effect/http/HttpServerRequest" |
| 11 | |
| 12 | /** |
| 13 | * Returns the underlying web-standard `Request` from an Effect `HttpServerRequest`. |
| 14 | * |
| 15 | * @category accessors |
| 16 | * @since 4.0.0 |
| 17 | */ |
| 18 | export const toDenoServerRequest = (self: HttpServerRequest): Request => (self as any).source |