update-emoji.js 677 B

123456789101112131415161718192021222324252627
  1. module.exports = {
  2. updateEmoji () {
  3. const emojis = require('@kazvmoe-infra/unicode-emoji-json/data-by-group')
  4. const fs = require('fs')
  5. Object.keys(emojis)
  6. .map(k => {
  7. emojis[k].map(e => {
  8. delete e.unicode_version
  9. delete e.emoji_version
  10. delete e.skin_tone_support_unicode_version
  11. })
  12. })
  13. const res = {}
  14. Object.keys(emojis)
  15. .map(k => {
  16. const groupId = k.replace('&', 'and').replace(/ /g, '-').toLowerCase()
  17. res[groupId] = emojis[k]
  18. })
  19. console.info('Updating emojis...')
  20. fs.writeFileSync('static/emoji.json', JSON.stringify(res))
  21. console.info('Done.')
  22. }
  23. }