@zip.js/zip.js 2.6.65 → 2.6.67

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.
@@ -6494,8 +6494,6 @@
6494
6494
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6495
6495
  */
6496
6496
 
6497
- /* global crypto */
6498
-
6499
6497
  const GET_RANDOM_VALUES_SUPPORTED = typeof crypto != "undefined" && typeof crypto.getRandomValues == "function";
6500
6498
 
6501
6499
  const ERR_INVALID_PASSWORD = "Invalid password";
@@ -7624,9 +7622,6 @@
7624
7622
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7625
7623
  */
7626
7624
 
7627
- /* global Blob, atob, btoa, XMLHttpRequest, URL, fetch, ReadableStream, WritableStream, FileReader, TransformStream, Response */
7628
- // deno-lint-ignore-file no-this-alias
7629
-
7630
7625
  const ERR_HTTP_STATUS = "HTTP error ";
7631
7626
  const ERR_HTTP_RANGE = "HTTP Range not supported";
7632
7627
  const ERR_ITERATOR_COMPLETED_TOO_SOON = "Writer iterator completed too soon";
@@ -9361,7 +9356,7 @@
9361
9356
  await skipDiskIfNeeded(writable);
9362
9357
  fileEntry.diskNumberStart = writer.diskNumber;
9363
9358
  diskOffset = writer.diskOffset;
9364
- await blob.stream().pipeTo(writable, { preventClose: true, signal });
9359
+ await blob.stream().pipeTo(writable, { preventClose: true, preventAbort: true, signal });
9365
9360
  writable.size += blob.size;
9366
9361
  writingBufferedEntryData = false;
9367
9362
  }
@@ -9377,7 +9372,11 @@
9377
9372
  if ((bufferedWrite && writingBufferedEntryData) || (!bufferedWrite && writingEntryData)) {
9378
9373
  zipWriter.hasCorruptedEntries = true;
9379
9374
  if (error) {
9380
- error.corruptedEntry = true;
9375
+ try {
9376
+ error.corruptedEntry = true;
9377
+ } catch (_error) {
9378
+ // ignored
9379
+ }
9381
9380
  }
9382
9381
  if (bufferedWrite) {
9383
9382
  zipWriter.offset += fileWriter.writable.size;
@@ -10140,6 +10139,15 @@
10140
10139
  }
10141
10140
  return Boolean(entry);
10142
10141
  }
10142
+
10143
+ rename(name) {
10144
+ const parent = this.parent;
10145
+ if (parent && parent.getChildByName(name)) {
10146
+ throw new Error("Entry filename already exists");
10147
+ } else {
10148
+ this.name = name;
10149
+ }
10150
+ }
10143
10151
  }
10144
10152
 
10145
10153
  class ZipFileEntry extends ZipEntry {