fix(web): emoji length computation (#1864)

This commit is contained in:
Mo
2022-10-23 11:04:17 -05:00
committed by GitHub
parent 1173a392c5
commit bda16b88c0
54 changed files with 826 additions and 21 deletions

View File

@@ -0,0 +1,7 @@
export function getEmojiLength(emoji: string): number {
try {
return [...new Intl.Segmenter().segment(emoji)].length
} catch (error) {
return [...emoji].length
}
}