fix(chunkify): remove dead whitespace check from merge else-if branch#87
Merged
bartveneman merged 4 commits intomainfrom Mar 17, 2026
Merged
fix(chunkify): remove dead whitespace check from merge else-if branch#87bartveneman merged 4 commits intomainfrom
bartveneman merged 4 commits intomainfrom
Conversation
The condition `offset !== text.length - 1` incorrectly skipped the trailing uncovered chunk when exactly one byte remained, silently dropping the last byte. Changed to `offset < text.length`. https://claude.ai/code/session_01CyibEZDpRhyvg4fw3edy1Z
The WHITESPACE_ONLY_REGEX.test() in the else-if was unreachable — the early continue at the top of the loop already handles all whitespace-only chunks. Keep only the empty-chunk (start === end) guard, which is the only reachable condition in that branch. Added tests for whitespace-gap merging and zero-length range absorption. https://claude.ai/code/session_01CyibEZDpRhyvg4fw3edy1Z
'a{color:red}\n\nb{color:blue}' is 27 chars (12+2+13),
so the second range end and expected end_offset should be 27, not 26.
https://claude.ai/code/session_01CyibEZDpRhyvg4fw3edy1Z
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
=======================================
Coverage ? 96.55%
=======================================
Files ? 14
Lines ? 1017
Branches ? 136
=======================================
Hits ? 982
Misses ? 34
Partials ? 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will decrease total bundle size by 91 bytes (-0.35%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: index.js-esmAssets Changed:
Files in
|
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.
No description provided.