Comparing version 3.2.0 to 3.2.1
19
index.js
@@ -30,6 +30,7 @@ 'use strict' | ||
const EMITDATA = Symbol('emitData') | ||
const EMITEND = Symbol('emitData') | ||
const EMITEND = Symbol('emitEnd') | ||
const EMITEND2 = Symbol('emitEnd2') | ||
const ASYNC = Symbol('async') | ||
const defer = fn => process.nextTick(fn) | ||
const defer = fn => Promise.resolve().then(fn) | ||
@@ -431,6 +432,3 @@ // TODO remove when Node v8 support drops | ||
} else if (ev === 'end') { | ||
// only actual end gets this treatment | ||
return this[EMITTED_END] ? false | ||
: this[ASYNC] ? defer(() => this[EMITEND]()) | ||
: this[EMITEND]() | ||
return this[EMITEND]() | ||
} else if (ev === 'close') { | ||
@@ -476,5 +474,14 @@ this[CLOSED] = true | ||
[EMITEND] () { | ||
if (this[EMITTED_END]) | ||
return | ||
this[EMITTED_END] = true | ||
this.readable = false | ||
if (this[ASYNC]) | ||
defer(() => this[EMITEND2]()) | ||
else | ||
this[EMITEND2]() | ||
} | ||
[EMITEND2] () { | ||
if (this[DECODER]) { | ||
@@ -481,0 +488,0 @@ const data = this[DECODER].end() |
{ | ||
"name": "minipass", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "minimal implementation of a PassThrough stream", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42013
533