@zip.js/zip.js 2.6.75 → 2.6.77

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 CHANGED
@@ -166,3 +166,6 @@ Run the code on Plunker: https://plnkr.co/edit/4sVljNIpqSUE9HCA?preview
166
166
 
167
167
  See here for more examples:
168
168
  https://github.com/gildas-lormeau/zip.js/tree/master/tests/all
169
+
170
+ Demo written wth React:
171
+ https://gildas-lormeau.github.io/zipjs-react-app
@@ -10384,7 +10384,7 @@
10384
10384
 
10385
10385
  async exportZip(writer, options) {
10386
10386
  const zipEntry = this;
10387
- await Promise.all([initReaders(zipEntry), initStream(writer)]);
10387
+ await Promise.all([initReaders(zipEntry, options), initStream(writer)]);
10388
10388
  const zipWriter = new ZipWriter(writer, options);
10389
10389
  await exportZip(zipWriter, zipEntry, getTotalSize([zipEntry], "uncompressedSize"), options);
10390
10390
  await zipWriter.close();
@@ -10571,13 +10571,15 @@
10571
10571
  };
10572
10572
  }
10573
10573
 
10574
- async function initReaders(entry) {
10574
+ async function initReaders(entry, options) {
10575
10575
  if (entry.children.length) {
10576
10576
  await Promise.all(entry.children.map(async child => {
10577
10577
  if (child.directory) {
10578
- await initReaders(child);
10578
+ const readerOptions = Object.assign({}, options);
10579
+ readerOptions.onprogress = null;
10580
+ await initReaders(child, readerOptions);
10579
10581
  } else {
10580
- const reader = child.reader = new child.Reader(child.data);
10582
+ const reader = child.reader = new child.Reader(child.data, options);
10581
10583
  await initStream(reader);
10582
10584
  child.uncompressedSize = reader.size;
10583
10585
  }