Repository navigation
fix(csv-parse): refresh trim state after BOM detection - #537
Open
nk-batman21 wants to merge 1 commit into
Open
nk-batman21 wants to merge 1 commit into
nk-batman21 wants to merge 1 commit into
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.
Fixes #536.
When a UTF-16LE BOM changes the encoding, trimming still uses buffers prepared for the initial encoding. For example, parsing
Buffer.from("\ufeff a , b ", "utf16le")with{ bom: true, trim: true }returns[["愀", "戀"]]instead of[["a", "b"]].Refresh the encoding-dependent trim buffers and lookahead sizes after BOM detection, preserving the existing parser state and byte offsets. Add sync and byte-sized streaming regressions for spaces and nonbreaking spaces with
trimandltrim.Validation on Node.js 24.18.0:
group_columns_by_namevalidation assertion.git diff --checkpass.The full test command still fails that existing assertion: it expects
"an boolean"while the source now returns"a boolean"after #525. The same failure was verified with pristine production code.