@nickbusey/thelounge
Version:
The self-hosted Web IRC client
21 lines (20 loc) • 630 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const emoji_regex_1 = __importDefault(require("emoji-regex"));
const regExp = (0, emoji_regex_1.default)();
function findEmoji(text) {
const result = [];
let match;
while ((match = regExp.exec(text))) {
result.push({
start: match.index,
end: match.index + match[0].length,
emoji: match[0],
});
}
return result;
}
exports.default = findEmoji;