Use includes instead of indexOf
This commit is contained in:
parent
03535246a4
commit
5dbd259e01
|
@ -92,10 +92,7 @@
|
||||||
};
|
};
|
||||||
rules = {
|
rules = {
|
||||||
required: value => !!value || 'Required.',
|
required: value => !!value || 'Required.',
|
||||||
email: (value) => {
|
email: (value) => value.includes('@') || 'Invalid e-mail.',
|
||||||
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.';
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
user: any;
|
user: any;
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
rules = {
|
rules = {
|
||||||
password_length: value => value.length > 6 || 'Password must be at least 6 characters long',
|
password_length: value => value.length > 6 || 'Password must be at least 6 characters long',
|
||||||
required: value => !!value || 'Required.',
|
required: value => !!value || 'Required.',
|
||||||
email: (value: string) => value.indexOf('@') !== -1 || 'Invalid e-mail.',
|
email: (value: string) => value.includes('@') || 'Invalid e-mail.',
|
||||||
};
|
};
|
||||||
|
|
||||||
resetState() {
|
resetState() {
|
||||||
|
|
Loading…
Reference in a new issue