Skip to content

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

@SalimBensiali

Description

@SalimBensiali

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions