How to use the emojibase.fromCodepointToUnicode function in emojibase

To help you get started, we’ve selected a few emojibase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github milesj / interweave / packages / emoji / src / EmojiDataManager.ts View on Github external
emoji.primary_shortcode = emoji.canonical_shortcodes[0];

    // Support all shortcodes
    emoji.canonical_shortcodes.forEach(shortcode => {
      this.SHORTCODE_TO_HEXCODE[shortcode] = hexcode;
    });

    // Support all emoticons
    if (emoticon) {
      generateEmoticonPermutations(emoticon, EMOTICON_OPTIONS[emoticon]).forEach(emo => {
        this.EMOTICON_TO_HEXCODE[emo] = hexcode;
      });
    }

    // Support all presentations (even no variation selectors)
    this.UNICODE_TO_HEXCODE[fromCodepointToUnicode(fromHexcodeToCodepoint(hexcode))] = hexcode;

    if (emoji.emoji) {
      this.UNICODE_TO_HEXCODE[emoji.emoji] = hexcode;
    }

    if (emoji.text) {
      this.UNICODE_TO_HEXCODE[emoji.text] = hexcode;
    }

    // Map each emoji
    this.EMOJIS[hexcode] = emoji;

    // Apply same logic to all variations
    if (baseEmoji.skins) {
      emoji.skins = baseEmoji.skins.map(skinEmoji => this.packageEmoji(skinEmoji));
    }