Skip to content

Commit 9bf0f00

Browse files
committed
remove (slow) string-width library
1 parent 2cb845a commit 9bf0f00

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

bun.lock

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

display/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"@types/bun": "^1.2.11"
3232
},
3333
"dependencies": {
34-
"grapheme-splitter": "^1.0.4",
35-
"string-width": "^8.1.0"
34+
"grapheme-splitter": "^1.0.4"
3635
}
3736
}

display/src/grapheme-image.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import GraphemeSplitter from 'grapheme-splitter'
22
import { isEqual } from 'lodash'
3-
import stringWidth from 'string-width'
43
import stripAnsi from 'strip-ansi'
54

65
import {
@@ -36,10 +35,7 @@ export function toGraphemeString(grapheme: string): $GraphemeString {
3635

3736
const first = splitter.iterateGraphemes(stripped).next()
3837
.value as $GraphemeString
39-
if (stringWidth(first) < 1) {
40-
return BLANK_GRAPHEME
41-
}
42-
return first
38+
return first as $GraphemeString
4339
}
4440

4541
function equalStyles(a: Grapheme, b: Grapheme): boolean {

0 commit comments

Comments
 (0)