Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const filterEmojis = () => {
let count = 0
const fEmojis = Object.keys(emojiData.emojis).filter((emoji) => {
let emojiKeywords = emoji
if (emojiData.emojis[emoji].j) {
emojiKeywords = `${emoji}|${emojiData.emojis[emoji].j.join(',')}`
}
const isMatch = emojiKeywords.includes(messageText.replace(':', ''))
if (isMatch) {
count++
if (count > 10) {
return
}
return isMatch
}
})
setEmojisFound(!!fEmojis.length)
const fEmojis = Object.keys(emojiData.emojis).filter((emoji) => {
let emojiKeywords = emoji
if (emojiData.emojis[emoji].j) {
emojiKeywords = `${emoji}|${emojiData.emojis[emoji].j.join(',')}`
}
const isMatch = emojiKeywords.includes(messageText.replace(':', ''))
if (isMatch) {
count++
if (count > 10) {
return
}
return isMatch
}
})
setEmojisFound(!!fEmojis.length)