@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-fs-full.js +15 -11
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +15 -11
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-full.js +15 -11
- package/dist/zip-full.min.js +1 -1
- package/dist/zip-no-worker-deflate.min.js +1 -1
- package/dist/zip-no-worker-inflate.min.js +1 -1
- package/dist/zip-no-worker.min.js +1 -1
- package/dist/zip.js +15 -11
- package/dist/zip.min.js +1 -1
- package/lib/core/io.js +5 -1
- package/package.json +1 -1
package/dist/zip-fs-full.js
CHANGED
|
@@ -7688,7 +7688,7 @@
|
|
|
7688
7688
|
const writer = this;
|
|
7689
7689
|
writer.contentType = contentType;
|
|
7690
7690
|
writer.transformStream = new TransformStream();
|
|
7691
|
-
Object.defineProperty(
|
|
7691
|
+
Object.defineProperty(writer, "writable", {
|
|
7692
7692
|
get() {
|
|
7693
7693
|
return writer.transformStream.writable;
|
|
7694
7694
|
}
|
|
@@ -7702,7 +7702,11 @@
|
|
|
7702
7702
|
transformStream,
|
|
7703
7703
|
contentType
|
|
7704
7704
|
} = writer;
|
|
7705
|
-
|
|
7705
|
+
const headers = [];
|
|
7706
|
+
if (contentType) {
|
|
7707
|
+
headers.push(["content-type", contentType]);
|
|
7708
|
+
}
|
|
7709
|
+
writer.blob = new Response(transformStream.readable, { headers }).blob();
|
|
7706
7710
|
}
|
|
7707
7711
|
|
|
7708
7712
|
getData() {
|
|
@@ -8956,11 +8960,11 @@
|
|
|
8956
8960
|
externalFileAttribute,
|
|
8957
8961
|
useCompressionStream
|
|
8958
8962
|
});
|
|
8959
|
-
const
|
|
8963
|
+
const headerInfo = getHeaderInfo(options);
|
|
8960
8964
|
const dataDescriptorInfo = getDataDescriptorInfo(options);
|
|
8961
|
-
maximumEntrySize =
|
|
8965
|
+
maximumEntrySize = headerInfo.localHeaderArray.length + maximumCompressedSize + dataDescriptorInfo.dataDescriptorArray.length;
|
|
8962
8966
|
zipWriter.pendingEntriesSize += maximumEntrySize;
|
|
8963
|
-
const fileEntry = await getFileEntry(zipWriter, name, reader, {
|
|
8967
|
+
const fileEntry = await getFileEntry(zipWriter, name, reader, { headerInfo, dataDescriptorInfo }, options);
|
|
8964
8968
|
if (maximumEntrySize) {
|
|
8965
8969
|
zipWriter.pendingEntriesSize -= maximumEntrySize;
|
|
8966
8970
|
}
|
|
@@ -9086,7 +9090,7 @@
|
|
|
9086
9090
|
|
|
9087
9091
|
async function createFileEntry(reader, writer, pendingFileEntry, entryInfo, config, options) {
|
|
9088
9092
|
const {
|
|
9089
|
-
|
|
9093
|
+
headerInfo,
|
|
9090
9094
|
dataDescriptorInfo
|
|
9091
9095
|
} = entryInfo;
|
|
9092
9096
|
const {
|
|
@@ -9101,7 +9105,7 @@
|
|
|
9101
9105
|
rawExtraFieldExtendedTimestamp,
|
|
9102
9106
|
rawExtraFieldNTFS,
|
|
9103
9107
|
rawExtraFieldAES
|
|
9104
|
-
} =
|
|
9108
|
+
} = headerInfo;
|
|
9105
9109
|
const { dataDescriptorArray } = dataDescriptorInfo;
|
|
9106
9110
|
const {
|
|
9107
9111
|
rawFilename,
|
|
@@ -9188,7 +9192,7 @@
|
|
|
9188
9192
|
rawExtraFieldZip64,
|
|
9189
9193
|
compressedSize,
|
|
9190
9194
|
uncompressedSize,
|
|
9191
|
-
|
|
9195
|
+
headerInfo,
|
|
9192
9196
|
dataDescriptorInfo
|
|
9193
9197
|
}, options);
|
|
9194
9198
|
}
|
|
@@ -9212,7 +9216,7 @@
|
|
|
9212
9216
|
return fileEntry;
|
|
9213
9217
|
}
|
|
9214
9218
|
|
|
9215
|
-
function
|
|
9219
|
+
function getHeaderInfo(options) {
|
|
9216
9220
|
const {
|
|
9217
9221
|
rawFilename,
|
|
9218
9222
|
lastAccessDate,
|
|
@@ -9370,13 +9374,13 @@
|
|
|
9370
9374
|
rawExtraFieldZip64,
|
|
9371
9375
|
compressedSize,
|
|
9372
9376
|
uncompressedSize,
|
|
9373
|
-
|
|
9377
|
+
headerInfo,
|
|
9374
9378
|
dataDescriptorInfo
|
|
9375
9379
|
} = entryInfo;
|
|
9376
9380
|
const {
|
|
9377
9381
|
headerView,
|
|
9378
9382
|
encrypted
|
|
9379
|
-
} =
|
|
9383
|
+
} = headerInfo;
|
|
9380
9384
|
const {
|
|
9381
9385
|
dataDescriptorView,
|
|
9382
9386
|
dataDescriptorOffset
|