(body: unknown, status = 200)
| 4 | import type { ResolvedCredential } from "./resolver.js"; |
| 5 | |
| 6 | function jsonFetch(body: unknown, status = 200): typeof fetch { |
| 7 | return (async () => |
| 8 | new Response(JSON.stringify(body), { |
| 9 | status, |
| 10 | headers: { "content-type": "application/json" }, |
| 11 | })) as unknown as typeof fetch; |
| 12 | } |
| 13 | |
| 14 | function textFetch(body: string, status: number): typeof fetch { |
| 15 | return (async () => new Response(body, { status })) as unknown as typeof fetch; |