fix: streaming mode bug

This commit is contained in:
orion 2024-05-02 13:17:14 -05:00
parent e3c89adaed
commit bb25b8f562
Signed by: orion
GPG Key ID: 6D4165AE4C928719

View File

@ -10,8 +10,8 @@ class ParserWithColumns extends Parser {
/** @type {(s: import('csv-parse').Options) => () => ParserWithColumns} */
export const makeImpl = c => () => {
const parser = new ParserWithColumns(c)
parser.once('data', chunk => {
parser.columns = chunk;
parser.once('readable', () => {
parser.columns = parser.read();
})
return parser
}