Skip to content

Commit

Permalink
fix: add change to end output streams to prevent MaxListenersExceeded…
Browse files Browse the repository at this point in the history
…Warning
  • Loading branch information
harrismcc committed Jun 1, 2023
1 parent 42c96ed commit 7ca4303
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/unzip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ export class UnzipStream extends Transform {
// TODO: Do we really want to end the stream manually like this? Seems to work either way
// this.entry.end(undefined, encoding);

// Kill and re-make the outStream. This prevents memory issues and
// stops node from emitting MaxListenersExceededWarning
this.outStream.end();
this.outStream = new PassThrough();

// Queue up next state
this.mode = Mode.ReadingNextFlag;
this.chunks = [rest];
Expand Down

0 comments on commit 7ca4303

Please sign in to comment.