You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
326 B
10 lines
326 B
import * as Joi from "joi";
|
|
|
|
export const UserSchema = Joi.object({
|
|
username: Joi.string().alphanum().min(6).max(35),
|
|
password: Joi.string().pattern(new RegExp("^[a-zA-Z0-9]{3,30}$")).required(),
|
|
email: Joi.string().email({
|
|
minDomainSegments: 2,
|
|
tlds: { allow: ["com", "net"] },
|
|
})
|
|
}).or("username", "email");
|
|
|