1/**
2 * Accessor for the Bun request behind an Effect HTTP server request.
3 *
4 * This module exports `toBunServerRequest`, which returns the underlying
5 * `Bun.BunRequest` stored inside a Bun-backed `HttpServerRequest`. It is meant
6 * for code that needs to interoperate with Bun-specific request APIs.
7 *
8 * @since 4.0.0
9 */
10import type { HttpServerRequest } from "effect/http/HttpServerRequest"
11
12/**
13 * Returns the underlying `Bun.BunRequest` from an Effect `HttpServerRequest`.
14 *
15 * @category accessors
16 * @since 4.0.0
17 */
18export const toBunServerRequest = <T extends string = string>(self: HttpServerRequest): Bun.BunRequest<T> =>
19 (self as any).source