@zip.js/zip.js 2.6.67 → 2.6.68

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/lib/core/io.js CHANGED
@@ -262,8 +262,8 @@ class FetchReader extends Reader {
262
262
  }
263
263
 
264
264
  async init() {
265
- super.init();
266
265
  await initHttpReader(this, sendFetchRequest, getFetchRequestData);
266
+ super.init();
267
267
  }
268
268
 
269
269
  readUint8Array(index, length) {
@@ -279,8 +279,8 @@ class XHRReader extends Reader {
279
279
  }
280
280
 
281
281
  async init() {
282
- super.init();
283
282
  await initHttpReader(this, sendXMLHttpRequest, getXMLHttpRequestData);
283
+ super.init();
284
284
  }
285
285
 
286
286
  readUint8Array(index, length) {
@@ -467,8 +467,8 @@ class HttpReader extends Reader {
467
467
  }
468
468
 
469
469
  async init() {
470
- super.init();
471
470
  await this.reader.init();
471
+ super.init();
472
472
  }
473
473
 
474
474
  readUint8Array(index, length) {
@@ -503,11 +503,11 @@ class Uint8ArrayReader extends Reader {
503
503
  class Uint8ArrayWriter extends Writer {
504
504
 
505
505
  init(initSize = 0) {
506
- super.init();
507
506
  Object.assign(this, {
508
507
  offset: 0,
509
508
  array: new Uint8Array(initSize)
510
509
  });
510
+ super.init();
511
511
  }
512
512
 
513
513
  writeUint8Array(array) {
@@ -534,7 +534,6 @@ class SplitDataReader extends Reader {
534
534
  }
535
535
 
536
536
  async init() {
537
- super.init();
538
537
  const reader = this;
539
538
  const { readers } = reader;
540
539
  reader.lastDiskNumber = 0;
@@ -542,6 +541,7 @@ class SplitDataReader extends Reader {
542
541
  await diskReader.init();
543
542
  reader.size += diskReader.size;
544
543
  }));
544
+ super.init();
545
545
  }
546
546
 
547
547
  async readUint8Array(offset, length, diskNumber = 0) {
@@ -504,12 +504,12 @@ function getZipBlobReader(options) {
504
504
  }
505
505
 
506
506
  async init() {
507
- super.init();
508
507
  const zipBlobReader = this;
509
508
  zipBlobReader.size = zipBlobReader.entry.uncompressedSize;
510
509
  const data = await zipBlobReader.entry.getData(new BlobWriter(), Object.assign({}, zipBlobReader.options, options));
511
510
  zipBlobReader.data = data;
512
511
  zipBlobReader.blobReader = new BlobReader(data);
512
+ super.init();
513
513
  }
514
514
 
515
515
  readUint8Array(index, length) {
@@ -520,7 +520,7 @@ function getZipBlobReader(options) {
520
520
 
521
521
  async function initReaders(entry) {
522
522
  if (entry.children.length) {
523
- for (const child of entry.children) {
523
+ await Promise.all(entry.children.map(async child => {
524
524
  if (child.directory) {
525
525
  await initReaders(child);
526
526
  } else {
@@ -528,7 +528,7 @@ async function initReaders(entry) {
528
528
  await initStream(reader);
529
529
  child.uncompressedSize = reader.size;
530
530
  }
531
- }
531
+ }));
532
532
  }
533
533
  }
534
534
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A JavaScript library to zip and unzip files in the browser, Deno and Node.js",
4
4
  "author": "Gildas Lormeau",
5
5
  "license": "BSD-3-Clause",
6
- "version": "2.6.67",
6
+ "version": "2.6.68",
7
7
  "type": "module",
8
8
  "keywords": [
9
9
  "zip",