@zip.js/zip.js 2.11.0 → 2.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8626,7 +8626,7 @@ function formatSupported(StreamClass, format) {
8626
8626
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8627
8627
  */
8628
8628
 
8629
- const VERSION = "2.11.0";
8629
+ const VERSION = "2.11.1";
8630
8630
 
8631
8631
  /*
8632
8632
  Copyright (c) 2025 Gildas Lormeau. All rights reserved.
@@ -9215,18 +9215,17 @@ function _make(isCompress, type, options = {}) {
9215
9215
  }
9216
9216
  heap.set(buffer.subarray(offset, offset + toRead), this.in);
9217
9217
  const result = process(this.streamHandle, this.in, toRead, out, outBufferSize, 0);
9218
+ // checked before the byte count is used, so a status code can never be read as one
9219
+ const code = (result >> 24) & 0xff;
9220
+ const signedCode = (code & 0x80) ? code - 256 : code;
9221
+ if (signedCode < 0) {
9222
+ throw new Error("process error:" + signedCode);
9223
+ }
9218
9224
  const prod = result & 0x00ffffff;
9219
9225
  if (prod) {
9220
9226
  scratch.set(heap.subarray(out, out + prod), 0);
9221
9227
  controller.enqueue(scratch.slice(0, prod));
9222
9228
  }
9223
- if (!isCompress) {
9224
- const code = (result >> 24) & 0xff;
9225
- const signedCode = (code & 0x80) ? code - 256 : code;
9226
- if (signedCode < 0) {
9227
- throw new Error("process error:" + signedCode);
9228
- }
9229
- }
9230
9229
  const consumed = last_consumed(this.streamHandle);
9231
9230
  if (consumed === 0 && prod === 0) {
9232
9231
  break;
@@ -9246,14 +9245,12 @@ function _make(isCompress, type, options = {}) {
9246
9245
  const scratch = this._scratch;
9247
9246
  while (true) {
9248
9247
  const result = process(this.streamHandle, 0, 0, out, outBufferSize, 4);
9249
- const produced = result & 0x00ffffff;
9250
9248
  const code = (result >> 24) & 0xff;
9251
- if (!isCompress) {
9252
- const signedCode = (code & 0x80) ? code - 256 : code;
9253
- if (signedCode < 0) {
9254
- throw new Error("process error:" + signedCode);
9255
- }
9249
+ const signedCode = (code & 0x80) ? code - 256 : code;
9250
+ if (signedCode < 0) {
9251
+ throw new Error("process error:" + signedCode);
9256
9252
  }
9253
+ const produced = result & 0x00ffffff;
9257
9254
  if (produced) {
9258
9255
  scratch.set(heap.subarray(out, out + produced), 0);
9259
9256
  controller.enqueue(scratch.slice(0, produced));