logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

emoji_mart_data_light.js (976B)


  1. // The output of this module is designed to mimic emoji-mart's
  2. // "data" object, such that we can use it for a light version of emoji-mart's
  3. // emojiIndex.search functionality.
  4. const { unicodeToUnifiedName } = require('./unicode_to_unified_name');
  5. const [ shortCodesToEmojiData, skins, categories, short_names ] = require('./emoji_compressed');
  6. const emojis = {};
  7. // decompress
  8. Object.keys(shortCodesToEmojiData).forEach((shortCode) => {
  9. let [
  10. filenameData, // eslint-disable-line no-unused-vars
  11. searchData,
  12. ] = shortCodesToEmojiData[shortCode];
  13. let [
  14. native,
  15. short_names,
  16. search,
  17. unified,
  18. ] = searchData;
  19. if (!unified) {
  20. // unified name can be derived from unicodeToUnifiedName
  21. unified = unicodeToUnifiedName(native);
  22. }
  23. short_names = [shortCode].concat(short_names);
  24. emojis[shortCode] = {
  25. native,
  26. search,
  27. short_names,
  28. unified,
  29. };
  30. });
  31. module.exports = {
  32. emojis,
  33. skins,
  34. categories,
  35. short_names,
  36. };