Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1x 1x 1x 2x 1x 1x 1x 1x | import {fromStream} from '../streams/fromStream';
import {toStream} from '../streams/toStream';
const pipeThrough = async (
data: Uint8Array,
transform: ReadableWritablePair<Uint8Array, Uint8Array>,
): Promise<Uint8Array> => await fromStream(toStream(data).pipeThrough<Uint8Array>(transform));
export const gzip = async (data: Uint8Array): Promise<Uint8Array> =>
await pipeThrough(data, new CompressionStream('gzip') as any);
export const ungzip = async (data: Uint8Array): Promise<Uint8Array> =>
await pipeThrough(data, new DecompressionStream('gzip') as any);
|