Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
rtrim: trueortrim: true, whitespace after a closing quote is recognized but only its first byte is skipped. The remaining bytes then triggerCSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE.For example,
parse(Buffer.from('"a"\u3000,"b"'), { trim: true })currently throws instead of returning[['a', 'b']]. UTF-16LE also fails with ordinary spaces because they occupy two bytes.Advance past the complete matched trim character when discarding trailing whitespace, as the leading-whitespace path already does. Add regressions for UTF-8 and UTF-16LE, both options, empty quoted fields, field/record boundaries and EOF, preservation of whitespace inside quotes, one-byte stream writes, and rejection of a non-whitespace character after the padding.
Validation on Node.js v24.22.1:
npm run test --workspace=csv-parse: 641 passing, 2 pending; TypeScript check passes.npm run build --workspace=csv-parsepasses.Related to the whitespace support introduced in #483. This addresses consuming already-recognized trim characters after quotes; it does not change the BOM state refresh in #537. The fixtures specify their record delimiter to keep this separate from #539.
AI-assisted implementation and local verification.