Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/denoland/std
/ unicodeWidth
Function
unicodeWidth
cli/unicode_width.ts:77–79 ·
view source on GitHub ↗
(str: string)
Source
from the content-addressed store, hash-verified
75
* {@linkcode unicodeWidth}.
76
*/
77
export
function
unicodeWidth(str: string): number {
78
return
[...str].map((ch) => charWidth(ch) ?? 0).reduce((a, b) => a + b, 0);
79
}
Callers
2
unicode_width_test.ts
File · 0.90
fn
Function · 0.90
Calls
1
charWidth
Function · 0.85
Tested by
no test coverage detected