Code imports rearranged and updated for better consistency. Missing semicolons were added in multiple files to improve code readability and standards compliance. The usage of whitespace and indentation was also standardized across multiple files to improve overall code clarity.
20 lines
509 B
TypeScript
20 lines
509 B
TypeScript
const Validators = {
|
|
isEmail: (value: string) => {
|
|
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,32}$/;
|
|
return emailRegex.test(value);
|
|
},
|
|
isUsername: (value: string) => {
|
|
const usernameRegex = /^[a-zA-Z0-9._]{3,14}$/;
|
|
return usernameRegex.test(value);
|
|
},
|
|
//displayName
|
|
|
|
isPassword: (value: string) => {
|
|
const passwordRegex =
|
|
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,32}$/;
|
|
return passwordRegex.test(value);
|
|
},
|
|
};
|
|
|
|
export default Validators;
|