From 01bb36d43171c340cb10028e938d2c3afadb2049 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 29 Aug 2023 17:28:54 +0200 Subject: [PATCH] Use proper argument to deflateInit() This was an accidental copy error from inflator.js. The second argument to deflateInit() is the compression level, not the window bits. We have not strong opinions on an appropriate level, so stick to the default. --- core/deflator.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/deflator.js b/core/deflator.js index fe2a8f7..22f6770 100644 --- a/core/deflator.js +++ b/core/deflator.js @@ -7,7 +7,7 @@ */ import { deflateInit, deflate } from "../vendor/pako/lib/zlib/deflate.js"; -import { Z_FULL_FLUSH } from "../vendor/pako/lib/zlib/deflate.js"; +import { Z_FULL_FLUSH, Z_DEFAULT_COMPRESSION } from "../vendor/pako/lib/zlib/deflate.js"; import ZStream from "../vendor/pako/lib/zlib/zstream.js"; export default class Deflator { @@ -15,9 +15,8 @@ export default class Deflator { this.strm = new ZStream(); this.chunkSize = 1024 * 10 * 10; this.outputBuffer = new Uint8Array(this.chunkSize); - this.windowBits = 5; - deflateInit(this.strm, this.windowBits); + deflateInit(this.strm, Z_DEFAULT_COMPRESSION); } deflate(inData) {