fix(frontend): unhance check controls

This commit is contained in:
yassinedorbozgithub 2024-10-21 11:31:00 +01:00
parent c4a1c16b94
commit e683a831e1

View File

@ -268,7 +268,11 @@ const PatternInput: FC<PatternInputProps> = ({
{...registerInput(t("message.regex_is_invalid"), idx, {
validate: (pattern) => {
try {
if (typeof pattern === "string")
if (
pattern.at(0) === "/" &&
pattern.at(-1) === "/" &&
typeof pattern === "string"
)
new RegExp(pattern.slice(1, -1));
return true;