MCPcopy Create free account
hub / github.com/Effect-TS/effect / get

Function get

packages/effect/test/unstable/http/HttpCompression.test.ts:23–33  ·  view source on GitHub ↗
(
  handler: (request: Request) => Promise<Response>,
  headers?: Record<string, string>,
  method?: string
)

Source from the content-addressed store, hash-verified

21type CompressionOptions = Parameters<typeof HttpMiddleware.compression>[0]
22
23const 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
35const decompress = (data: ArrayBuffer, format: "gzip" | "deflate"): Promise<string> =>
36 new Response(new Blob([data]).stream().pipeThrough(new DecompressionStream(format))).text()

Callers 1

Calls 1

handlerFunction · 0.70

Tested by

no test coverage detected