Skip to content

Commit

Permalink
v0.5.1
Browse files Browse the repository at this point in the history
* Fixed issue where line data was not being passed between transforms in the parser_stream
  • Loading branch information
doug-martin committed Aug 28, 2014
1 parent 0957c0c commit 64b4fbe
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
4 changes: 4 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.5.1

* Fixed issue where line data was not being passed between transforms in the parser_stream

# v0.5.0

* Added support for async transforms [#24](https://github.com/C2FO/fast-csv/issues/24)
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.5.1</h1>
<ul>
<li>Fixed issue where line data was not being passed between transforms in the parser_stream</li>
</ul>
<h1>v0.5.0</h1>
<ul>
<li>Added support for async transforms <a href="https://github.com/C2FO/fast-csv/issues/24">#24</a></li>
Expand Down
24 changes: 14 additions & 10 deletions lib/parser/parser_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,24 @@ extended(ParserStream).extend({
},

_parse: function _parseLine(data, hasMoreData, cb) {
var row, count, ret, rows, self = this;
var rows, self = this;
try {
data = this.parser(data, hasMoreData);
rows = data.rows;
if (!this._parsedHeaders) {
this.__processHeaders(rows, function (err) {
if (err) {
cb(err);
} else {
self.__processRows(rows, data, cb);
}
});
if (rows.length) {
if (!this._parsedHeaders) {
this.__processHeaders(rows, function (err) {
if (err) {
cb(err);
} else {
self.__processRows(rows, data, cb);
}
});
} else {
this.__processRows(rows, data, cb);
}
} else {
this.__processRows(rows, data, cb);
cb(null, data.line);
}
} catch (e) {
this.emit("error", e);
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.5.0",
"version": "0.5.1",
"description": "CSV parser and writer",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 64b4fbe

Please sign in to comment.