function compressArrayBuffer(input) {
const stream = new Blob(input)
.stream()
.pipeThrough(new CompressionStream('deflate'));
return new Response(stream).arrayBuffer();
}
I guess it's a little hacky, but the following example already uses blob/response, so maybe it's ok?
https://github.com/wicg/compression/blob/master/explainer.md#deflate-compress-an-arraybuffer-to-a-uint8array
It could be:
I guess it's a little hacky, but the following example already uses blob/response, so maybe it's ok?