You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

11 lines
296 B

'use strict';
import * as emojis from './emojis.json';
const emojiMap = (emojis as any).default as Record<string, string>;
const emojiRegex = /:([-+_a-z0-9]+):/g;
export function emojify(message: string) {
return message.replace(emojiRegex, (s, code) => {
return emojiMap[code] || s;
});
}