Move error handling to Inflate class

Every call wants this check so this should be done inside the class.
This commit is contained in:
Niko Lehto
2020-02-03 09:57:56 +01:00
committed by Lauri Kasanen
parent 5e4544d5fc
commit b690ae4c2d
2 changed files with 4 additions and 6 deletions

View File

@@ -37,6 +37,10 @@ export default class Inflate {
inflate(this.strm, 0); // Flush argument not used.
if (this.strm.next_out != expected) {
throw new Error("Incomplete zlib block");
}
return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
}