Skip to content

Commit 85798b2

Browse files
author
ricael
committed
improv: remover o emojiRefex() da função isEmoji.
1 parent 71ebecb commit 85798b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/controllers/sendMessage.controller.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ import { BadRequestException } from '@exceptions';
1919
import { isBase64, isURL } from 'class-validator';
2020
import emojiRegex from 'emoji-regex';
2121

22+
const regex = emojiRegex();
23+
2224
function isEmoji(str: string) {
2325
if (str === '') return true;
2426

25-
const match = str.match(emojiRegex());
27+
const match = str.match(regex);
2628
return match?.length === 1 && match[0] === str;
2729
}
2830

0 commit comments

Comments
 (0)