2021-08-11 08:13:38 +00:00
|
|
|
const json = require('unicode-emoji-json/data-by-group.json')
|
|
|
|
const fs = require('fs')
|
2021-07-10 13:21:47 +00:00
|
|
|
|
2021-08-11 08:13:38 +00:00
|
|
|
const newArray = []
|
2021-07-10 13:21:47 +00:00
|
|
|
for (const [key, value] of Object.entries(json)) {
|
|
|
|
const newData = value.map((emoji) => ({
|
|
|
|
emoji: emoji.emoji,
|
|
|
|
name: emoji.name,
|
2021-07-22 09:42:45 +00:00
|
|
|
v: emoji.unicode_version,
|
2021-08-11 08:13:38 +00:00
|
|
|
}))
|
2021-07-12 09:17:39 +00:00
|
|
|
newArray.push({
|
|
|
|
title: key.replace(' & ', '_').replace(' ', '_').toLocaleLowerCase(),
|
|
|
|
data: newData,
|
2021-08-11 08:13:38 +00:00
|
|
|
})
|
2021-07-10 13:21:47 +00:00
|
|
|
}
|
|
|
|
|
2021-08-11 08:13:38 +00:00
|
|
|
fs.writeFile('./src/assets/emojis.json', JSON.stringify(newArray), function (err) {
|
|
|
|
if (err) return console.log(err)
|
|
|
|
console.log('emojis.json successfully saved to assets folder')
|
|
|
|
})
|