Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const getEmojiDataByEmoticon = (emoticon: string, data: Data) => {
const emojiIndex = new NimbleEmojiIndex(data);
let emojiData: BaseEmoji | undefined;
const emoticonName = Object.keys(emoticonMap).find(name => emoticonMap[name].includes(emoticon));
if (emoticonName) {
emojiData = Object.values(emojiIndex.emojis)
.filter(isBaseEmoji)
.find(item => item.name === emoticonName);
}
return emojiData;
};