mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Reject reactions with invalid number of graphemes
This commit is contained in:
+6
-1
@@ -1,7 +1,12 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { size } from './iterables';
|
||||
import { map, size } from './iterables';
|
||||
|
||||
export function getGraphemes(str: string): Iterable<string> {
|
||||
const segments = new Intl.Segmenter().segment(str);
|
||||
return map(segments, s => s.segment);
|
||||
}
|
||||
|
||||
export function count(str: string): number {
|
||||
const segments = new Intl.Segmenter().segment(str);
|
||||
|
||||
Reference in New Issue
Block a user