thelounge/client/dist/js/helpers/ircmessageparser/findEmoji.js

17 lines
352 B
JavaScript
Raw Normal View History

2022-05-02 09:50:13 +02:00
"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;
//# sourceMappingURL=findEmoji.js.map