From 85798b209cb045f0da98f45106e0de49c445fd03 Mon Sep 17 00:00:00 2001 From: ricael Date: Thu, 17 Jul 2025 09:43:52 -0300 Subject: [PATCH] =?UTF-8?q?improv:=20remover=20o=20emojiRefex()=20da=20fun?= =?UTF-8?q?=C3=A7=C3=A3o=20isEmoji.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/controllers/sendMessage.controller.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/controllers/sendMessage.controller.ts b/src/api/controllers/sendMessage.controller.ts index 60bc9195..64aa1c84 100644 --- a/src/api/controllers/sendMessage.controller.ts +++ b/src/api/controllers/sendMessage.controller.ts @@ -19,10 +19,12 @@ import { BadRequestException } from '@exceptions'; import { isBase64, isURL } from 'class-validator'; import emojiRegex from 'emoji-regex'; +const regex = emojiRegex(); + function isEmoji(str: string) { if (str === '') return true; - const match = str.match(emojiRegex()); + const match = str.match(regex); return match?.length === 1 && match[0] === str; }