@zip.js/zip.js 2.6.74 → 2.6.76
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 +9 -7
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +9 -7
- package/dist/zip-fs.min.js +1 -1
- package/index.cjs +9 -7
- package/index.d.ts +1 -1
- package/lib/core/zip-fs-core.js +9 -7
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1190,7 +1190,7 @@ declare class ZipEntry {
|
|
|
1190
1190
|
*
|
|
1191
1191
|
* @param deepClone `true` to clone all the descendants.
|
|
1192
1192
|
*/
|
|
1193
|
-
clone(deepClone
|
|
1193
|
+
clone(deepClone?: boolean): ZipEntry
|
|
1194
1194
|
/**
|
|
1195
1195
|
* Returns the full filename of the entry
|
|
1196
1196
|
*/
|
package/lib/core/zip-fs-core.js
CHANGED
|
@@ -221,9 +221,9 @@ class ZipDirectoryEntry extends ZipEntry {
|
|
|
221
221
|
const clonedEntry = new ZipDirectoryEntry(zipEntry.fs, zipEntry.name);
|
|
222
222
|
if (deepClone) {
|
|
223
223
|
clonedEntry.children = zipEntry.children.map(child => {
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
return
|
|
224
|
+
const childClone = child.clone(deepClone);
|
|
225
|
+
childClone.parent = clonedEntry;
|
|
226
|
+
return childClone;
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
return clonedEntry;
|
|
@@ -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), initStream(writer)]);
|
|
350
|
+
await Promise.all([initReaders(zipEntry, options), 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();
|
|
@@ -535,13 +535,15 @@ function getZipBlobReader(options) {
|
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
-
async function initReaders(entry) {
|
|
538
|
+
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
|
-
|
|
542
|
+
const readerOptions = Object.assign({}, options);
|
|
543
|
+
readerOptions.onprogress = null;
|
|
544
|
+
await initReaders(child, readerOptions);
|
|
543
545
|
} else {
|
|
544
|
-
const reader = child.reader = new child.Reader(child.data);
|
|
546
|
+
const reader = child.reader = new child.Reader(child.data, options);
|
|
545
547
|
await initStream(reader);
|
|
546
548
|
child.uncompressedSize = reader.size;
|
|
547
549
|
}
|
package/package.json
CHANGED