2017-06-28 13:35:14 +03:00
|
|
|
#!/usr/bin/env node
|
|
|
|
const EMOJI_DATA = require('emojione/emoji.json');
|
2017-07-05 19:09:16 +03:00
|
|
|
const EMOJI_SUPPORTED = Object.keys(require('emojione').emojioneList);
|
2017-06-28 13:35:14 +03:00
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
const output = Object.keys(EMOJI_DATA).map(
|
|
|
|
(key) => {
|
|
|
|
const datum = EMOJI_DATA[key];
|
2017-06-29 13:29:55 +03:00
|
|
|
const newDatum = {
|
2017-06-28 13:35:14 +03:00
|
|
|
name: datum.name,
|
|
|
|
shortname: datum.shortname,
|
|
|
|
category: datum.category,
|
|
|
|
emoji_order: datum.emoji_order,
|
|
|
|
};
|
2018-07-24 19:06:45 +03:00
|
|
|
if (datum.aliases.length > 0) {
|
|
|
|
newDatum.aliases = datum.aliases;
|
|
|
|
}
|
2017-06-29 13:29:55 +03:00
|
|
|
if (datum.aliases_ascii.length > 0) {
|
|
|
|
newDatum.aliases_ascii = datum.aliases_ascii;
|
|
|
|
}
|
|
|
|
return newDatum;
|
|
|
|
}
|
2017-07-05 19:09:16 +03:00
|
|
|
).filter((datum) => {
|
|
|
|
return EMOJI_SUPPORTED.includes(datum.shortname);
|
|
|
|
});
|
2017-06-28 13:35:14 +03:00
|
|
|
|
2017-06-28 15:44:44 +03:00
|
|
|
// Write to a file in src. Changes should be checked into git. This file is copied by
|
|
|
|
// babel using --copy-files
|
2017-06-28 15:28:48 +03:00
|
|
|
fs.writeFileSync('./src/stripped-emoji.json', JSON.stringify(output));
|