Use includes instead of indexOf
This commit is contained in:
parent
03535246a4
commit
5dbd259e01
@ -92,10 +92,7 @@
|
||||
};
|
||||
rules = {
|
||||
required: value => !!value || 'Required.',
|
||||
email: (value) => {
|
||||
const pattern = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
return pattern.test(value) || 'Invalid e-mail.';
|
||||
},
|
||||
email: (value) => value.includes('@') || 'Invalid e-mail.',
|
||||
};
|
||||
user: any;
|
||||
|
||||
|
@ -123,7 +123,7 @@
|
||||
rules = {
|
||||
password_length: value => value.length > 6 || 'Password must be at least 6 characters long',
|
||||
required: value => !!value || 'Required.',
|
||||
email: (value: string) => value.indexOf('@') !== -1 || 'Invalid e-mail.',
|
||||
email: (value: string) => value.includes('@') || 'Invalid e-mail.',
|
||||
};
|
||||
|
||||
resetState() {
|
||||
|
Loading…
Reference in New Issue
Block a user