@zip.js/zip.js 2.6.22 → 2.6.23

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.
package/dist/zip-full.js CHANGED
@@ -6687,7 +6687,7 @@
6687
6687
  const writer = this;
6688
6688
  writer.contentType = contentType;
6689
6689
  writer.transformStream = new TransformStream();
6690
- Object.defineProperty(this, "writable", {
6690
+ Object.defineProperty(writer, "writable", {
6691
6691
  get() {
6692
6692
  return writer.transformStream.writable;
6693
6693
  }
@@ -6701,7 +6701,11 @@
6701
6701
  transformStream,
6702
6702
  contentType
6703
6703
  } = writer;
6704
- writer.blob = new Response(transformStream.readable).blob({ type: contentType });
6704
+ const headers = [];
6705
+ if (contentType) {
6706
+ headers.push(["content-type", contentType]);
6707
+ }
6708
+ writer.blob = new Response(transformStream.readable, { headers }).blob();
6705
6709
  }
6706
6710
 
6707
6711
  getData() {
@@ -7955,11 +7959,11 @@
7955
7959
  externalFileAttribute,
7956
7960
  useCompressionStream
7957
7961
  });
7958
- const localHeaderInfo = getLocalHeaderInfo(options);
7962
+ const headerInfo = getHeaderInfo(options);
7959
7963
  const dataDescriptorInfo = getDataDescriptorInfo(options);
7960
- maximumEntrySize = localHeaderInfo.localHeaderArray.length + maximumCompressedSize + dataDescriptorInfo.dataDescriptorArray.length;
7964
+ maximumEntrySize = headerInfo.localHeaderArray.length + maximumCompressedSize + dataDescriptorInfo.dataDescriptorArray.length;
7961
7965
  zipWriter.pendingEntriesSize += maximumEntrySize;
7962
- const fileEntry = await getFileEntry(zipWriter, name, reader, { localHeaderInfo, dataDescriptorInfo }, options);
7966
+ const fileEntry = await getFileEntry(zipWriter, name, reader, { headerInfo, dataDescriptorInfo }, options);
7963
7967
  if (maximumEntrySize) {
7964
7968
  zipWriter.pendingEntriesSize -= maximumEntrySize;
7965
7969
  }
@@ -8085,7 +8089,7 @@
8085
8089
 
8086
8090
  async function createFileEntry(reader, writer, pendingFileEntry, entryInfo, config, options) {
8087
8091
  const {
8088
- localHeaderInfo,
8092
+ headerInfo,
8089
8093
  dataDescriptorInfo
8090
8094
  } = entryInfo;
8091
8095
  const {
@@ -8100,7 +8104,7 @@
8100
8104
  rawExtraFieldExtendedTimestamp,
8101
8105
  rawExtraFieldNTFS,
8102
8106
  rawExtraFieldAES
8103
- } = localHeaderInfo;
8107
+ } = headerInfo;
8104
8108
  const { dataDescriptorArray } = dataDescriptorInfo;
8105
8109
  const {
8106
8110
  rawFilename,
@@ -8187,7 +8191,7 @@
8187
8191
  rawExtraFieldZip64,
8188
8192
  compressedSize,
8189
8193
  uncompressedSize,
8190
- localHeaderInfo,
8194
+ headerInfo,
8191
8195
  dataDescriptorInfo
8192
8196
  }, options);
8193
8197
  }
@@ -8211,7 +8215,7 @@
8211
8215
  return fileEntry;
8212
8216
  }
8213
8217
 
8214
- function getLocalHeaderInfo(options) {
8218
+ function getHeaderInfo(options) {
8215
8219
  const {
8216
8220
  rawFilename,
8217
8221
  lastAccessDate,
@@ -8369,13 +8373,13 @@
8369
8373
  rawExtraFieldZip64,
8370
8374
  compressedSize,
8371
8375
  uncompressedSize,
8372
- localHeaderInfo,
8376
+ headerInfo,
8373
8377
  dataDescriptorInfo
8374
8378
  } = entryInfo;
8375
8379
  const {
8376
8380
  headerView,
8377
8381
  encrypted
8378
- } = localHeaderInfo;
8382
+ } = headerInfo;
8379
8383
  const {
8380
8384
  dataDescriptorView,
8381
8385
  dataDescriptorOffset