Switched to regex literals

This commit is contained in:
Daniel Cojocea committed 2024-07-18 20:31:47 -04:00
1 parent abf60cfca5
commit c25f3d8172
2 files changed
+16 -20

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ const nameSchema = joi
.string()
.max(50)
.trim()
.pattern(new RegExp("^[A-Za-z]+$"))
.pattern(/^[A-Za-z]+$/)
.messages({
"string.empty": "Name is required",
"string.max": "Name must be less than 50 characters long",