UNPKG

@lobehub/fluent-emoji

Version:

Fluent Emoji are a collection of familiar, friendly, and modern emoji from Microsoft

1 lines 979 B
{"version":3,"file":"index.mjs","names":["EmojiLab"],"sources":["../../src/getEmojiByCharacter/index.ts"],"sourcesContent":["/**\n * `@lobehub/emojilib` exposes a bare `index.json` as its entry, which Node's ESM\n * loader rejects without an explicit type attribute.\n */\nimport emojilib from '@lobehub/emojilib/index.json' with { type: 'json' };\nimport emojiRegex from 'emoji-regex';\n\nexport const getEmoji = (emoji: string): string | undefined => {\n const regex = emojiRegex();\n const pureEmoji = emoji.match(regex)?.[0];\n return pureEmoji;\n};\n\nexport const getEmojiNameByCharacter = (emoji: string): string | undefined => {\n const pureEmoji = getEmoji(emoji);\n if (!pureEmoji) return;\n const EmojiLab: any = emojilib;\n return EmojiLab?.[pureEmoji];\n};\n"],"mappings":";;;;;;;AAOA,MAAa,YAAY,UAAsC;CAC7D,MAAM,QAAQ,WAAW;CAEzB,OADkB,MAAM,MAAM,KAAK,CAAC,GAAG;AAEzC;AAEA,MAAa,2BAA2B,UAAsC;CAC5E,MAAM,YAAY,SAAS,KAAK;CAChC,IAAI,CAAC,WAAW;CAEhB,OAAOA,WAAW;AACpB"}