@zip.js/zip.js 2.6.77 → 2.6.79
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/README.md +6 -4
- package/dist/zip-fs-full.js +12 -5
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +12 -5
- package/dist/zip-fs.min.js +1 -1
- package/index.cjs +12 -5
- package/index.d.ts +4 -0
- package/lib/core/zip-fs-core.js +12 -5
- package/package.json +1 -1
package/lib/core/zip-fs-core.js
CHANGED
|
@@ -347,7 +347,7 @@ class ZipDirectoryEntry extends ZipEntry {
|
|
|
347
347
|
|
|
348
348
|
async exportZip(writer, options) {
|
|
349
349
|
const zipEntry = this;
|
|
350
|
-
await Promise.all([initReaders(zipEntry, options), initStream(writer)]);
|
|
350
|
+
await Promise.all([initReaders(zipEntry, options.readerOptions), initStream(writer)]);
|
|
351
351
|
const zipWriter = new ZipWriter(writer, options);
|
|
352
352
|
await exportZip(zipWriter, zipEntry, getTotalSize([zipEntry], "uncompressedSize"), options);
|
|
353
353
|
await zipWriter.close();
|
|
@@ -539,12 +539,19 @@ async function initReaders(entry, options) {
|
|
|
539
539
|
if (entry.children.length) {
|
|
540
540
|
await Promise.all(entry.children.map(async child => {
|
|
541
541
|
if (child.directory) {
|
|
542
|
-
|
|
543
|
-
readerOptions.onprogress = null;
|
|
544
|
-
await initReaders(child, readerOptions);
|
|
542
|
+
await initReaders(child, options);
|
|
545
543
|
} else {
|
|
546
544
|
const reader = child.reader = new child.Reader(child.data, options);
|
|
547
|
-
|
|
545
|
+
try {
|
|
546
|
+
await initStream(reader);
|
|
547
|
+
} catch (error) {
|
|
548
|
+
try {
|
|
549
|
+
error.entryId = child.id;
|
|
550
|
+
} catch (_error) {
|
|
551
|
+
// ignored
|
|
552
|
+
}
|
|
553
|
+
throw error;
|
|
554
|
+
}
|
|
548
555
|
child.uncompressedSize = reader.size;
|
|
549
556
|
}
|
|
550
557
|
}));
|
package/package.json
CHANGED