import zlib from "pako";

/**
 *
 * @param {Uint8Array} encoded_chunk
 * @returns {ArrayBuffer}
 */
export function inflate(encoded_chunk) {
    const inflator = new zlib.Inflate();


    inflator.push(encoded_chunk);

    if (inflator.err) {
        throw new Error(inflator.err);
    }


    return inflator.result.buffer;
}