node-csvtojson
node-csvtojson copied to clipboard
maxRowLength not respected when using streaming option
In the scenario where a very large csv file has an unclosed quote in an early line, the library is trying to bring in all the data until the closing quote is found.
Should maxRowLength be working here to raise an error?
Should there be code checking this value in Converter._transform()? I was hoping to see a fix and submit a PR, but I'm not positive where to add a reference. It seems like perhaps maxRowLength isn't referenced at all in streams(?)
In Converter.checkAndFlush, I see a an error type referenced called "CSVError.unclosed_quote"
Have others gotten this to work and/or did it work in previous releases?
csvtojson({
delimiter: 'auto',
ignoreEmpty: false,
maxRowLength: 10000,
}).fromFile(filePath).subscribe(
(record: any, index: number) => {
return new Promise(async (resolve, reject) => {
...
})
},
....
)