mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-15 20:54:01 -05:00
09e86ef90b
fix style "©"削除処理をemojione_lightに移動
14 lines
598 B
JavaScript
14 lines
598 B
JavaScript
// @preval
|
|
// Force tree shaking on emojione by exposing just a subset of its functionality
|
|
|
|
const emojione = require('emojione');
|
|
|
|
const mappedUnicode = emojione.mapUnicodeToShort();
|
|
const excluded = ['®', '©', '™'];
|
|
|
|
module.exports.unicodeMapping = Object.keys(emojione.jsEscapeMap)
|
|
.filter(c => !excluded.includes(c))
|
|
.map(unicodeStr => [unicodeStr, mappedUnicode[emojione.jsEscapeMap[unicodeStr]]])
|
|
.map(([unicodeStr, shortCode]) => ({ [unicodeStr]: [emojione.emojioneList[shortCode].fname, shortCode.slice(1, shortCode.length - 1)] }))
|
|
.reduce((x, y) => Object.assign(x, y), { });
|