mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-26 10:28:38 -06:00
improv: remover o emojiRefex() da função isEmoji.
This commit is contained in:
parent
71ebecbed3
commit
85798b209c
@ -19,10 +19,12 @@ import { BadRequestException } from '@exceptions';
|
|||||||
import { isBase64, isURL } from 'class-validator';
|
import { isBase64, isURL } from 'class-validator';
|
||||||
import emojiRegex from 'emoji-regex';
|
import emojiRegex from 'emoji-regex';
|
||||||
|
|
||||||
|
const regex = emojiRegex();
|
||||||
|
|
||||||
function isEmoji(str: string) {
|
function isEmoji(str: string) {
|
||||||
if (str === '') return true;
|
if (str === '') return true;
|
||||||
|
|
||||||
const match = str.match(emojiRegex());
|
const match = str.match(regex);
|
||||||
return match?.length === 1 && match[0] === str;
|
return match?.length === 1 && match[0] === str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user