Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v8.2.0 #268

Merged
merged 2 commits into from
Jul 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v3.2.0

* [FIXED] Invalid row index doesn't reflect original row count [#130](https://github.com/C2FO/fast-csv/issues/130) [#266](https://github.com/C2FO/fast-csv/pull/266) - [@chrwnsk](https://github.com/chrwnsk)

# v3.1.0

* Skip trailing whitespace after a quoted field [#223](https://github.com/C2FO/fast-csv/pull/223) - [@peet](https://github.com/peet)
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": "3.1.0",
"version": "3.2.0",
"description": "CSV parser and writer",
"main": "./build/src/index.js",
"types": "./build/src/index.d.ts",
Expand Down
1 change: 0 additions & 1 deletion src/parser/CsvParserStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export default class CsvParserStream extends Transform {
return cb(new Error('expected transform result'));
}
if (!transformResult.isValid) {
this.rowCount -= 1;
this.emit('data-invalid', transformResult.row, nextRowCount, transformResult.reason);
} else if (!transformResult.row) {
this.rowCount -= 1;
Expand Down
6 changes: 3 additions & 3 deletions test/parser/CsvParsingStream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe('CsvParserStream', () => {
.then(({ count, rows, invalidRows }) => {
assert.deepStrictEqual(rows, expectedRows);
assert.deepStrictEqual(invalidRows, expectedInvalidRows);
assert.strictEqual(count, rows.length);
assert.strictEqual(count, rows.length + invalidRows.length);
});
});

Expand Down Expand Up @@ -280,7 +280,7 @@ describe('CsvParserStream', () => {
.then(({ count, rows, invalidRows }) => {
assert.deepStrictEqual(invalidRows, invalidValid[1]);
assert.deepStrictEqual(rows, invalidValid[0]);
assert.strictEqual(count, invalidValid[0].length);
assert.strictEqual(count, invalidValid[0].length + invalidValid[1].length);
});
});

Expand All @@ -294,7 +294,7 @@ describe('CsvParserStream', () => {
.then(({ count, rows, invalidRows }) => {
assert.deepStrictEqual(invalidRows, invalidValid[1]);
assert.deepStrictEqual(rows, invalidValid[0]);
assert.strictEqual(count, invalidValid[0].length);
assert.strictEqual(count, invalidValid[0].length + invalidValid[1].length);
});
});

Expand Down