signal-desktop/ts/util/isEmojiOnlyText.tsx
2021-10-06 10:37:53 -07:00

9 lines
295 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as grapheme from './grapheme';
import { getEmojiCount } from '../components/emoji/lib';
export function isEmojiOnlyText(text: string): boolean {
return grapheme.count(text) === getEmojiCount(text);
}