-
-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Description
- Operating System: Any
- Node Version: Any
- NPM Version: Any
- csv-parser Version: 3.0.0
Expected Behavior
The assert in the repro passes.
Actual Behavior
The assert in the repro fails.
How Do We Reproduce?
import { deepStrictEqual } from 'node:assert';
import { Readable } from 'node:stream';
import csvParserFactory from 'csv-parser';
deepStrictEqual(
await Readable.from(["foo\r", "\nbar\r\n", "baz\r\n"])
.pipe(csvParserFactory())
.toArray(),
await Readable.from(["foo\r\n", "bar\r\n", "baz\r\n"])
.pipe(csvParserFactory())
.toArray(),
);Cause
This happens because csv-parser is fine with nextChr being null when this.state.first is true. Instead it should wait until there's at least one more byte or the input stream is closed.
Ricki-BumbleDev and thenickdude
Metadata
Metadata
Assignees
Labels
No labels