Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const emoji = function() {
_.each(emojis, (emoji, name) => {
emoji.keywords.unshift(name);
});
this.textComplete.register([
{
id: 'emoji',
match: /(^|\s)[::]([a-z0-9+\-\_]*)$/,
search: function (term, callback) {
const emojiNames = [];
_.forEach(emojis, (emoji, name)=> {
if (emoji.keywords.join(' ').toLowerCase().indexOf(term.toLowerCase()) > -1) {
emojiNames.push(name);
}
});
callback(emojiNames);
},