1
0
Fork 0
forked from gitea/nas

Code-split emoji-mart picker and data (#5175)

This commit is contained in:
Nolan Lawson 2017-10-01 22:22:24 -07:00 committed by Eugen Rochko
parent d841af4e80
commit b9c612b561
7 changed files with 348 additions and 10 deletions

View file

@ -0,0 +1,17 @@
// @preval
const data = require('emoji-mart/dist/data').default;
const pick = require('lodash/pick');
const condensedEmojis = {};
Object.keys(data.emojis).forEach(key => {
condensedEmojis[key] = pick(data.emojis[key], ['short_names', 'unified', 'search']);
});
// JSON.parse/stringify is to emulate what @preval is doing and avoid any
// inconsistent behavior in dev mode
module.exports = JSON.parse(JSON.stringify({
emojis: condensedEmojis,
skins: data.skins,
categories: data.categories,
short_names: data.short_names,
}));