mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-16 21:24:18 -05:00
12 lines
481 B
JavaScript
12 lines
481 B
JavaScript
|
// @preval
|
||
|
// Force tree shaking on emojione by exposing just a subset of its functionality
|
||
|
|
||
|
const emojione = require('emojione');
|
||
|
|
||
|
const mappedUnicode = emojione.mapUnicodeToShort();
|
||
|
|
||
|
module.exports.unicodeToFilename = Object.keys(emojione.jsEscapeMap)
|
||
|
.map(unicodeStr => [unicodeStr, mappedUnicode[emojione.jsEscapeMap[unicodeStr]]])
|
||
|
.map(([unicodeStr, shortCode]) => ({ [unicodeStr]: emojione.emojioneList[shortCode].fname }))
|
||
|
.reduce((x, y) => Object.assign(x, y), { });
|