This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/client/js/helpers/ircmessageparser/findEmoji.js
2020-11-01 22:46:04 +00:00

21 lines
319 B
JavaScript

"use strict";
const emojiRegExp = require("emoji-regex")();
function findEmoji(text) {
const result = [];
let match;
while ((match = emojiRegExp.exec(text))) {
result.push({
start: match.index,
end: match.index + match[0].length,
emoji: match[0],
});
}
return result;
}
export default findEmoji;