- 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.
Expected Behavior
The assert in the repro passes.
Actual Behavior
The assert in the repro fails.
How Do We Reproduce?
Cause
This happens because
csv-parseris fine withnextChrbeingnullwhenthis.state.firstistrue. Instead it should wait until there's at least one more byte or the input stream is closed.