This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -61,15 +61,15 @@ export const DATA_BY_CATEGORY = {
61
61
62
62
// Store various mappings from unicode/emoticon/shortcode to the Emoji objects
63
63
export const EMOJI : IEmoji [ ] = EMOJIBASE . map ( ( emojiData : Omit < IEmoji , "shortcodes" > ) => {
64
- const shortcodeData = SHORTCODES [ emojiData . hexcode ] ;
64
+ // If there's ever a gap in shortcode coverage, we fudge it by
65
+ // filling it in with the emoji's CLDR annotation
66
+ const shortcodeData = SHORTCODES [ emojiData . hexcode ] ??
67
+ [ emojiData . annotation . toLowerCase ( ) . replace ( / / g, "_" ) ] ;
68
+
65
69
const emoji : IEmoji = {
66
70
...emojiData ,
67
71
// Homogenize shortcodes by ensuring that everything is an array
68
- shortcodes : typeof shortcodeData === "string" ?
69
- [ shortcodeData ] :
70
- // If there's ever a gap in shortcode coverage, we fudge it by
71
- // filling it in with the emoji's CLDR annotation
72
- ( shortcodeData ?? [ emojiData . annotation . toLowerCase ( ) . replace ( / / g, "_" ) ] ) ,
72
+ shortcodes : typeof shortcodeData === "string" ? [ shortcodeData ] : shortcodeData ,
73
73
} ;
74
74
75
75
const categoryId = EMOJIBASE_GROUP_ID_TO_CATEGORY [ emoji . group ] ;
You can’t perform that action at this time.
0 commit comments