csv icon indicating copy to clipboard operation
csv copied to clipboard

Bug with single column csv text not ending a trailing line break

Open SalimBensiali opened this issue 8 months ago • 1 comments

Hi, it seems there is a bug where single column csv content that does not end with a line break gets the last "cell" value deleted when parsed. I have created a PR where I updated the tests to expose the issue, but do not have enough knowledge to fix the issue. I have tried updating the code at https://github.com/vanillaes/csv/blob/main/index.js#L104-L107 to honour flushing of the last value using if (ctx.value !== '') instead but that seems to break some other tests.

Any ideas on how to fix this would be appreciated.

Cheers

SalimBensiali avatar Jun 11 '24 04:06 SalimBensiali