minipass
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -122,5 +122,12 @@ const EE = require('events') | ||
get emittedEnd () { | ||
return this[EMITTED_END] | ||
} | ||
[MAYBE_EMIT_END] () { | ||
if (!this[EMITTED_END] && this.buffer.length === 0 && this[EOF]) | ||
if (!this[EMITTED_END] && this.buffer.length === 0 && this[EOF]) { | ||
this.emit('end') | ||
this.emit('finished') | ||
this.emit('close') | ||
} | ||
} | ||
@@ -127,0 +134,0 @@ |
{ | ||
"name": "minipass", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "minimal implementation of a PassThrough stream", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,4 +9,6 @@ const t = require('tap') | ||
mp.end() | ||
t.notOk(mp.emittedEnd) | ||
list.push('called end') | ||
mp.resume() | ||
t.ok(mp.emittedEnd) | ||
list.push('called resume') | ||
@@ -13,0 +15,0 @@ t.same(list, ['called end', 'end', 'called resume']) |
99401
760