Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: splitter.countDisplay helper functions #3

Open
mknj opened this issue Mar 26, 2021 · 0 comments
Open

feature request: splitter.countDisplay helper functions #3

mknj opened this issue Mar 26, 2021 · 0 comments

Comments

@mknj
Copy link

mknj commented Mar 26, 2021

Some characters are double width.
It would really be nice to have a helper function for that.
This function would be very useful to generate tables for shell/cli use.

example

const a="基于gulp和browserify的项目构建工具"
splitter.countDisplay(a) // should return 34 instead of 24

It would also be nice to support the zero-width joiner.

related work: https://github.com/unicode-rs/unicode-width

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant