Rewrite the restricted iterators and reorder the forward references. [skip build]
This commit is contained in:
1 parent
5477242661
commit
664b7eb739
25 files changed
+472
-437
No files matched your search
@@ -12,12 +12,16 @@ export function extractJumboEmojis(body: string): string[] {
|
||||
|
||||
const found: string[] = [];
|
||||
|
||||
for (const match of trimmedBody.matchAll(EMOJI_REG_G)) {
|
||||
const emojiMatches = Array.from(trimmedBody.matchAll(EMOJI_REG_G));
|
||||
for (let i = 0; i < emojiMatches.length; i += 1) {
|
||||
const match = emojiMatches[i];
|
||||
const emoji = match[1];
|
||||
if (emoji) found.push(emoji);
|
||||
}
|
||||
|
||||
for (const match of trimmedBody.matchAll(SHORTCODE_PATTERN)) {
|
||||
const shortcodeMatches = Array.from(trimmedBody.matchAll(SHORTCODE_PATTERN));
|
||||
for (let i = 0; i < shortcodeMatches.length; i += 1) {
|
||||
const match = shortcodeMatches[i];
|
||||
const shortcode = match[1];
|
||||
const resolved = emojis.find((emoji) => emoji.shortcode === shortcode);
|
||||
if (resolved) found.push(resolved.unicode);
|
||||
|
||||
Reference in new issue
Block a user