(algorithm: Algorithm, data: Uint8Array)
| 21 | const algorithms: ReadonlyArray<Algorithm> = ["gzip", "deflate", "br", "zstd"] |
| 22 | |
| 23 | const 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 | |
| 36 | const withHandler = async ( |
| 37 | app: App, |
no test coverage detected