leeoniya / uDSV

A faster CSV parser in 5KB (min)
MIT License
675 stars 15 forks source link

Unable to parse CSV with only one line #12

Closed cweijan closed 1 month ago

cweijan commented 5 months ago

example: inferSchema('a,b')

After execution, an error will occur: "Cannot read properties of null (reading '1')"

It must have a line break to be parsed correctly. I currently solve it by if (!csvStr.includes('\n')) csvStr += '\n';. I hope to release a new version with this fix.