@zip.js/zip.js 2.7.57 → 2.7.58

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.
@@ -0,0 +1,17 @@
1
+ # .github/workflows/publish.yml
2
+
3
+ name: Publish
4
+
5
+ on:
6
+ release:
7
+ types: [published]
8
+
9
+ jobs:
10
+ publish:
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read
14
+ id-token: write
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - run: npx jsr publish
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zip-js/zip-js",
3
- "version": "2.7.57",
3
+ "version": "2.7.58",
4
4
  "exports": {
5
5
  ".": "./index.js",
6
6
  "./data-uri": "./lib/zip-data-uri.js"
@@ -8406,6 +8406,7 @@
8406
8406
  const ERR_HTTP_STATUS = "HTTP error ";
8407
8407
  const ERR_HTTP_RANGE = "HTTP Range not supported";
8408
8408
  const ERR_ITERATOR_COMPLETED_TOO_SOON = "Writer iterator completed too soon";
8409
+ const ERR_WRITER_NOT_INITIALIZED = "Writer not initialized";
8409
8410
 
8410
8411
  const CONTENT_TYPE_TEXT_PLAIN = "text/plain";
8411
8412
  const HTTP_HEADER_CONTENT_LENGTH = "Content-Length";
@@ -8443,8 +8444,10 @@
8443
8444
  async pull(controller) {
8444
8445
  const { offset = 0, size, diskNumberStart } = readable;
8445
8446
  const { chunkOffset } = this;
8446
- controller.enqueue(await readUint8Array(reader, offset + chunkOffset, Math.min(chunkSize, size - chunkOffset), diskNumberStart));
8447
- if (chunkOffset + chunkSize > size) {
8447
+ const dataSize = size === UNDEFINED_VALUE ? chunkSize : Math.min(chunkSize, size - chunkOffset);
8448
+ const data = await readUint8Array(reader, offset + chunkOffset, dataSize, diskNumberStart);
8449
+ controller.enqueue(data);
8450
+ if ((chunkOffset + chunkSize > size) || (size === UNDEFINED_VALUE && !data.length && dataSize)) {
8448
8451
  controller.close();
8449
8452
  } else {
8450
8453
  this.chunkOffset += chunkSize;
@@ -8462,6 +8465,9 @@
8462
8465
  const writer = this;
8463
8466
  const writable = new WritableStream({
8464
8467
  write(chunk) {
8468
+ if (!writer.initialized) {
8469
+ throw new Error(ERR_WRITER_NOT_INITIALIZED);
8470
+ }
8465
8471
  return writer.writeUint8Array(chunk);
8466
8472
  }
8467
8473
  });
@@ -12051,6 +12057,7 @@
12051
12057
  exports.ERR_UNSUPPORTED_COMPRESSION = ERR_UNSUPPORTED_COMPRESSION;
12052
12058
  exports.ERR_UNSUPPORTED_ENCRYPTION = ERR_UNSUPPORTED_ENCRYPTION;
12053
12059
  exports.ERR_UNSUPPORTED_FORMAT = ERR_UNSUPPORTED_FORMAT;
12060
+ exports.ERR_WRITER_NOT_INITIALIZED = ERR_WRITER_NOT_INITIALIZED;
12054
12061
  exports.HttpRangeReader = HttpRangeReader;
12055
12062
  exports.HttpReader = HttpReader;
12056
12063
  exports.Reader = Reader;