Skip to content

Commit

Permalink
Merge pull request #3 from dcolens/patch-1
Browse files Browse the repository at this point in the history
chunkEnd not emitted if stream size < chunk size
  • Loading branch information
Olegas committed Jun 30, 2014
2 parents 5e0f233 + f662320 commit 8bcf954
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/size-chunker.js
Expand Up @@ -28,7 +28,7 @@
this._readableState.objectMode = true;

this.once('end', function () {
if (this._flushTail && this._lastEmittedChunk && this._bytesPassed > 0 ) {
if (this._flushTail && (this._lastEmittedChunk !== undefined) && this._bytesPassed > 0 ) {
this.emit('chunkEnd', this._currentChunk, nop);
}
});
Expand Down Expand Up @@ -113,4 +113,4 @@
module.exports = SizeChunker;


})();
})();

0 comments on commit 8bcf954

Please sign in to comment.