How to use the indexOf function from node-emoji
Find comprehensive JavaScript node-emoji.indexOf code examples handpicked from public code repositorys.
179 180 181 182 183 184 185 186 187 188
return str.split(emojiNameRegex) // parse emoji via regex .map(function parseEmoji(s, i) { // every second element is an emoji, e.g. "test :fast_forward:" -> [ "test ", "fast_forward" ] if (i % 2 === 0) return s; var emoji = Emoji._get(s); var isMissing = emoji.indexOf(':') > -1; if (isMissing && typeof on_missing === 'function') { return on_missing(s); }
0
1
0
node-emoji.get is the most popular function in node-emoji (2342 examples)