You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
807 B

  1. // @preval
  2. const data = require('emoji-mart/dist/data').default;
  3. const pick = require('lodash/pick');
  4. const values = require('lodash/values');
  5. const condensedEmojis = Object.keys(data.emojis).map(key => {
  6. if (!data.emojis[key].short_names[0] === key) {
  7. throw new Error('The condenser expects the first short_code to be the ' +
  8. 'key. It may need to be rewritten if the emoji change such that this ' +
  9. 'is no longer the case.');
  10. }
  11. return values(pick(data.emojis[key], ['short_names', 'unified', 'search']));
  12. });
  13. // JSON.parse/stringify is to emulate what @preval is doing and avoid any
  14. // inconsistent behavior in dev mode
  15. module.exports = JSON.parse(JSON.stringify({
  16. emojis: condensedEmojis,
  17. skins: data.skins,
  18. categories: data.categories,
  19. short_names: data.short_names,
  20. }));