The best way to control Claude Code, Codex and more from any computer or phone

main
ts 21 lines 704 Bytes
Raw
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 * @stability unstable
9 * @since 4.0.0
10 */
11 import type { HttpServerRequest } from "effect/http/HttpServerRequest"
12
13 /**
14 * Returns the underlying `Bun.BunRequest` from an Effect `HttpServerRequest`.
15 *
16 * @stability unstable
17 * @category accessors
18 * @since 4.0.0
19 */
20 export const toBunServerRequest = <T extends string = string>(self: HttpServerRequest): Bun.BunRequest<T> =>
21 (self as any).source