@zip.js/zip.js 2.5.8 → 2.5.9

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.
@@ -7433,7 +7433,7 @@
7433
7433
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7434
7434
  */
7435
7435
 
7436
- /* global Blob, FileReader, atob, btoa, XMLHttpRequest, document, fetch, ReadableStream, WritableStream */
7436
+ /* global Blob, FileReader, atob, btoa, XMLHttpRequest, document, fetch, ReadableStream, WritableStream, TransformStream */
7437
7437
 
7438
7438
  const ERR_HTTP_STATUS = "HTTP error ";
7439
7439
  const ERR_HTTP_RANGE = "HTTP Range not supported";
@@ -7673,9 +7673,15 @@
7673
7673
 
7674
7674
  class ReadableStreamReader {
7675
7675
 
7676
- constructor(readableStream, size = Infinity) {
7677
- this.readableStream = readableStream;
7678
- this.size = size;
7676
+ constructor(readableStream) {
7677
+ const reader = this;
7678
+ reader.readableStream = readableStream.pipeThrough(new TransformStream({
7679
+ transform(chunk, controller) {
7680
+ reader.size += chunk.length;
7681
+ controller.enqueue(chunk);
7682
+ }
7683
+ }));
7684
+ reader.size = 0;
7679
7685
  }
7680
7686
 
7681
7687
  init() {