You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I'm looking for something that can help truncate strings and add an ellipsis, similar to how macOS's Finder will truncate filenames in the middle of the string.
Would something that either achieves this or helps with it be considered within scope?
(Happy to try and write up a PR if so.)
For the former (achieving this), I'd imagine adding a new package that does this middle truncation, and similar to truncate would take a parameter similar to tail. (Not sure what a good name for the param would be off the top of my head, though.)
For the latter (helping with this), I have in mind a version of truncate that truncates counting from the right. (I guess it could almost be thought of like an RTL truncate?) An end-user would then end up using both truncate-from-left and truncate-from-right.
The text was updated successfully, but these errors were encountered:
rzhw
changed the title
macOS Finder style string truncation
Middle string truncation
Jul 24, 2023
Hey, I'm looking for something that can help truncate strings and add an ellipsis, similar to how macOS's Finder will truncate filenames in the middle of the string.
Would something that either achieves this or helps with it be considered within scope?
(Happy to try and write up a PR if so.)
For the former (achieving this), I'd imagine adding a new package that does this middle truncation, and similar to
truncate
would take a parameter similar totail
. (Not sure what a good name for the param would be off the top of my head, though.)For the latter (helping with this), I have in mind a version of
truncate
that truncates counting from the right. (I guess it could almost be thought of like an RTLtruncate
?) An end-user would then end up using both truncate-from-left and truncate-from-right.The text was updated successfully, but these errors were encountered: