New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mm 40 correct entry of non alphabetic characters #141
Mm 40 correct entry of non alphabetic characters #141
Conversation
…DI-SSI-Mobile into MM-40-correct-entry-of-non-alphabetic-characters
return Validations.isName(this.state.firstName) && Validations.isName(this.state.lastName); | ||
return Validations.isName(this.state.firstName) && Validations.isName(this.state.lastName); | ||
} | ||
private specialCharacter(): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si vamos a verificar por letras, con esta expresión es más claro /^(?:[A-Za-z])+$. Podemos hacer algo del estilo
const regExp = /^(?:[A-Za-z])+$;
const correctedFirstName = regExp.test(this.state.firstName);
const correctedLastName = regExp.test(this.state.lastName);
if (correctedTextLastName === this.state.lastName) { | ||
correctedLastName = true; | ||
} | ||
if (correctedFirstName === true && correctedLastName === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Para el return, se puede simplificar mediante
return correctedFirstName && correctedLastName
validacion2.mp4