Comparing version 0.2.0 to 0.2.1
@@ -35,3 +35,3 @@ var WritableStream = require('stream').Writable | ||
this._finished = false; | ||
this._sawFinish = false; | ||
this._realFinish = false; | ||
this._isPreamble = true; | ||
@@ -59,4 +59,3 @@ this._justMatched = false; | ||
Dicer.prototype.emit = function(ev) { | ||
if (ev === 'finish' && !this._sawFinish) { | ||
this._sawFinish = true; | ||
if (ev === 'finish' && !this._realFinish) { | ||
if (!this._finished) { | ||
@@ -71,9 +70,9 @@ var self = this; | ||
process.nextTick(function() { | ||
self._realFinish = true; | ||
self.emit('finish'); | ||
self.reset(); | ||
}); | ||
return; | ||
} | ||
self._realFinish = true; | ||
self.emit('finish'); | ||
self.reset(); | ||
}); | ||
@@ -209,4 +208,6 @@ } | ||
this._part.on('end', function() { | ||
if (--self._parts === 0 && self._finished) | ||
if (--self._parts === 0 && self._finished) { | ||
self._realFinish = true; | ||
self.emit('finish'); | ||
} | ||
}); | ||
@@ -213,0 +214,0 @@ } |
{ "name": "dicer", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"author": "Brian White <mscdex@mscdex.net>", | ||
@@ -4,0 +4,0 @@ "description": "A very fast streaming multipart parser for node.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
54818
1488