feat: refactor string truncate-middle to support grapheme clusters and code points - #13782
Open
ujjwalv01 wants to merge 4 commits into
Open
feat: refactor string truncate-middle to support grapheme clusters and code points#13782ujjwalv01 wants to merge 4 commits into
truncate-middle to support grapheme clusters and code points#13782ujjwalv01 wants to merge 4 commits into
Conversation
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This was referenced Jul 30, 2026
Member
|
@ujjwalv01 It is actually better if you split the packages into separate PRs. Why? Because we perform squash merging, and, for purposes of the changelog, we want one package added per commit. Obviously, the top-level package PR will be dependent on the corresponding base packages, but that is fine. Just open the top-level package after the base packages have been merged. |
Contributor
Author
|
@kgryte Understood! That makes complete sense for the changelog. I will focus on getting the two base package PRs merged first. We can leave this one on draft until those are merged, and then I'll rebase this branch so it only contains the top-level modifications. |
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.
Resolves part of #1062 (truncate-middle portion).
Description
This pull request:
@stdlib/string/base/truncate-middle-code-pointswhich truncates the middle Unicode code points of a string.@stdlib/string/base/truncate-middle-grapheme-clusterswhich truncates the middle grapheme clusters of a string.@stdlib/string/truncate-middleto act as a mode dispatcher, supportinggrapheme(default),code_point, andcode_unitmodes via anoptions.modeparameter.Related Issues
This pull request has the following related issues:
Questions
No.
Other
This PR supersedes the previously abandoned PR #1119. All changes requested by the reviewer in that PR (pluralizing the package name, making
seqa mandatory argument in base packages) have been incorporated.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
I utilized an AI assistant to automate the generation of test cases and benchmark scaffolding. The core logic implementation and integration were authored manually.
@stdlib-js/reviewers