Switched to regex literals
This commit is contained in:
1 parent
abf60cfca5
commit
c25f3d8172
2 files changed
+16
-20
No files matched your search
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user