signal-desktop/ts/util/isEmojiOnlyText.tsx

10 lines
295 B
TypeScript
Raw Normal View History

2021-10-06 17:37:53 +00:00
// 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);
}