Skip to content

Commit

Permalink
WIP 6
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Sep 22, 2019
1 parent fef31d7 commit d9fbab1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ class ChopStream extends Writable {
chunk = buffers[index];
chunkEnd = chunkStart + chunk.length;
}

// Call `._write()`'s callback if have streamed out all received
const cb = this._writeCb;
if (cb && chunkEnd === this._position) {
this._writeCb(null);
this._writeCb = null;
}
}

/**
Expand Down

0 comments on commit d9fbab1

Please sign in to comment.