mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
chore(console): complete documentation (#3901)
This commit is contained in:
parent
733b60e4b2
commit
6871f6bbc0
@ -57,6 +57,6 @@ function charWidth(ch: string) {
|
||||
* assertEquals(unicodeWidth(stripAnsiCode("\x1B]8;;https://deno.land\x07🦕\x1B]8;;\x07")), 2);
|
||||
* ```
|
||||
*/
|
||||
export function unicodeWidth(str: string) {
|
||||
export function unicodeWidth(str: string): number {
|
||||
return [...str].map((ch) => charWidth(ch) ?? 0).reduce((a, b) => a + b, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user