2020-03-27 13:59:38 -07:00
|
|
|
// The output of this module is designed to mimic emoji-mart's
|
|
|
|
// "data" object, such that we can use it for a light version of emoji-mart's
|
|
|
|
// emojiIndex.search functionality.
|
|
|
|
const { unicodeToUnifiedName } = require('./unicode_to_unified_name');
|
|
|
|
const [ shortCodesToEmojiData, skins, categories, short_names ] = require('./emoji_compressed');
|
|
|
|
|
|
|
|
const emojis = {};
|
|
|
|
|
|
|
|
// decompress
|
|
|
|
Object.keys(shortCodesToEmojiData).forEach((shortCode) => {
|
2021-08-03 10:10:42 -07:00
|
|
|
const [
|
2020-03-27 13:59:38 -07:00
|
|
|
filenameData, // eslint-disable-line no-unused-vars
|
|
|
|
searchData,
|
|
|
|
] = shortCodesToEmojiData[shortCode];
|
2021-08-03 10:10:42 -07:00
|
|
|
const [
|
2020-03-27 13:59:38 -07:00
|
|
|
native,
|
|
|
|
short_names,
|
|
|
|
search,
|
|
|
|
unified,
|
|
|
|
] = searchData;
|
|
|
|
|
|
|
|
emojis[shortCode] = {
|
|
|
|
native,
|
|
|
|
search,
|
2021-08-03 10:10:42 -07:00
|
|
|
short_names: [shortCode].concat(short_names),
|
|
|
|
unified: unified || unicodeToUnifiedName(native),
|
2020-03-27 13:59:38 -07:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
emojis,
|
|
|
|
skins,
|
|
|
|
categories,
|
|
|
|
short_names,
|
|
|
|
};
|