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

Function decompress

packages/platform/bun/test/BunHttpCompression.test.ts:23–34  ·  view source on GitHub ↗
(algorithm: Algorithm, data: Uint8Array)

Source from the content-addressed store, hash-verified

21const algorithms: ReadonlyArray<Algorithm> = ["gzip", "deflate", "br", "zstd"]
22
23const decompress = (algorithm: Algorithm, data: Uint8Array): string => {
24 switch (algorithm) {
25 case "gzip":
26 return Zlib.gunzipSync(data).toString()
27 case "deflate":
28 return Zlib.inflateSync(data).toString()
29 case "br":
30 return Zlib.brotliDecompressSync(data).toString()
31 case "zstd":
32 return Zlib.zstdDecompressSync(data).toString()
33 }
34}
35
36const withHandler = async (
37 app: App,

Callers 1

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected