@zip.js/zip.js 2.6.13 → 2.6.14
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 +14 -12
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +14 -12
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-full.js +13 -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 +13 -11
- package/dist/zip.min.js +1 -1
- package/index.d.ts +2 -1
- package/lib/core/io.js +11 -10
- package/lib/core/zip-fs-core.js +1 -1
- package/lib/core/zip-reader.js +2 -1
- package/package.json +2 -2
package/dist/zip-fs-full.js
CHANGED
|
@@ -7951,18 +7951,19 @@
|
|
|
7951
7951
|
|
|
7952
7952
|
class Uint8ArrayWriter extends Writer {
|
|
7953
7953
|
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
this.array = new Uint8Array();
|
|
7954
|
+
init(initSize = 0) {
|
|
7955
|
+
this.array = new Uint8Array(initSize);
|
|
7957
7956
|
}
|
|
7958
7957
|
|
|
7959
7958
|
writeUint8Array(array) {
|
|
7960
|
-
super.writeUint8Array(array);
|
|
7961
7959
|
const writer = this;
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7960
|
+
if (writer.size + array.length > writer.array.length) {
|
|
7961
|
+
const previousArray = writer.array;
|
|
7962
|
+
writer.array = new Uint8Array(previousArray.length + array.length);
|
|
7963
|
+
writer.array.set(previousArray);
|
|
7964
|
+
}
|
|
7965
|
+
writer.array.set(array, writer.size);
|
|
7966
|
+
super.writeUint8Array(array);
|
|
7966
7967
|
}
|
|
7967
7968
|
|
|
7968
7969
|
getData() {
|
|
@@ -7976,9 +7977,9 @@
|
|
|
7976
7977
|
return protocol == "http:" || protocol == "https:";
|
|
7977
7978
|
}
|
|
7978
7979
|
|
|
7979
|
-
async function initStream(stream) {
|
|
7980
|
+
async function initStream(stream, initSize) {
|
|
7980
7981
|
if (stream.init && !stream.initialized) {
|
|
7981
|
-
await stream.init();
|
|
7982
|
+
await stream.init(initSize);
|
|
7982
7983
|
}
|
|
7983
7984
|
}
|
|
7984
7985
|
|
|
@@ -8397,6 +8398,7 @@
|
|
|
8397
8398
|
bitFlag,
|
|
8398
8399
|
signature,
|
|
8399
8400
|
rawLastModDate,
|
|
8401
|
+
uncompressedSize,
|
|
8400
8402
|
compressedSize
|
|
8401
8403
|
} = zipEntry;
|
|
8402
8404
|
const localDirectory = zipEntry.localDirectory = {};
|
|
@@ -8437,7 +8439,7 @@
|
|
|
8437
8439
|
readable.size = size;
|
|
8438
8440
|
const { writable } = writer;
|
|
8439
8441
|
const signal = getOptionValue$1(zipEntry, options, "signal");
|
|
8440
|
-
await initStream(writer);
|
|
8442
|
+
await initStream(writer, uncompressedSize);
|
|
8441
8443
|
const { onstart, onprogress, onend } = options;
|
|
8442
8444
|
const workerOptions = {
|
|
8443
8445
|
options: {
|
|
@@ -9586,7 +9588,7 @@
|
|
|
9586
9588
|
return zipEntry.data;
|
|
9587
9589
|
} else {
|
|
9588
9590
|
const reader = zipEntry.reader = new zipEntry.Reader(zipEntry.data, options);
|
|
9589
|
-
await Promise.all([initStream(reader), initStream(writer)]);
|
|
9591
|
+
await Promise.all([initStream(reader), initStream(writer, zipEntry.data.uncompressedSize)]);
|
|
9590
9592
|
zipEntry.uncompressedSize = reader.size;
|
|
9591
9593
|
const readable = reader.readable;
|
|
9592
9594
|
readable.size = () => reader.size;
|