UNPKG

@chayns-components/emoji-input

Version:
20 lines 774 B
import { convertEmojisToUnicode } from './emoji'; import { loadEmojiShortList as loadList } from './asyncEmojiData'; let regShortnames; let shortNameList; export const loadEmojiShortList = async () => { if (regShortnames && shortNameList) return; ({ regShortnames, shortNameList } = await loadList()); }; export const convertEmojisToUnicodeAsync = async text => { await loadEmojiShortList(); return convertEmojiToUnicodeSync(text); }; export const convertEmojiToUnicodeSync = text => { if (!regShortnames || !shortNameList) throw new Error("convertEmojisToUnicodeSync requires to call loadEmojiShortList before being called"); return convertEmojisToUnicode(text, regShortnames, shortNameList); }; //# sourceMappingURL=convertEmojisToUnicodeAsync.js.map