This repository has been archived on 2024-10-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
website/components/Emoji/isStringWithOnlyOneEmoji.ts

7 lines
215 B
TypeScript

export const emojiRegex = /:\+1:|:-1:|:[\w-]+:/
export const isStringWithOnlyOneEmoji = (value: string): boolean => {
const result = emojiRegex.exec(value)
return result != null && result.input === result[0]
}