( handler: (request: Request) => Promise<Response>, headers?: Record<string, string>, method?: string )
| 21 | type CompressionOptions = Parameters<typeof HttpMiddleware.compression>[0] |
| 22 | |
| 23 | const get = ( |
| 24 | handler: (request: Request) => Promise<Response>, |
| 25 | headers?: Record<string, string>, |
| 26 | method?: string |
| 27 | ) => |
| 28 | handler( |
| 29 | new Request("http://localhost/", { |
| 30 | method: method ?? "GET", |
| 31 | ...(headers === undefined ? {} : { headers }) |
| 32 | }) |
| 33 | ) |
| 34 | |
| 35 | const decompress = (data: ArrayBuffer, format: "gzip" | "deflate"): Promise<string> => |
| 36 | new Response(new Blob([data]).stream().pipeThrough(new DecompressionStream(format))).text() |
no test coverage detected