Skip to content

Commit

Permalink
Merge pull request #44 from doug-martin/master
Browse files Browse the repository at this point in the history
v0.4.1
  • Loading branch information
doug-martin committed Jun 11, 2014
2 parents a78a590 + cc6aced commit 850fb75
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
4 changes: 4 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.4.1

* Fixed race condition that occured if you called pause during a flush.

# v0.4.0

* Fixed misspelling of `delimiter` [#40](https://github.com/C2FO/fast-csv/issues/40)
Expand Down
4 changes: 4 additions & 0 deletions docs/History.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@



<h1>v0.4.1</h1>
<ul>
<li>Fixed race condition that occured if you called pause during a flush.</li>
</ul>
<h1>v0.4.0</h1>
<ul>
<li>Fixed misspelling of <code>delimiter</code> <a href="https://github.com/C2FO/fast-csv/issues/40">#40</a></li>
Expand Down
17 changes: 14 additions & 3 deletions lib/parser_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,24 @@ extended(ParserStream).extend({
}
},

__doFlush: function (callback) {
//increment row count so we aren't 0 based
this.emit("end");
callback();
},

_flush: function (callback) {
if (this.lines) {
this._parse(this.lines, false);
}
//increment row count so we aren't 0 based
this.emit("end");
callback();
if (!this.paused) {
this.__doFlush(callback);
} else {
var self = this;
this.__pausedDone = function () {
self.__doFlush(callback);
};
}
},

__validate: function (data, index) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fast-csv",
"version": "0.4.0",
"version": "0.4.1",
"description": "CSV parser and writer",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 850fb75

Please sign in to comment.