Skip to content
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

fix: add locale parameter for isAlpha and isAlphanumeric validators #406

Merged
merged 4 commits into from
Sep 24, 2019
Merged

fix: add locale parameter for isAlpha and isAlphanumeric validators #406

merged 4 commits into from
Sep 24, 2019

Conversation

rubiin
Copy link
Contributor

@rubiin rubiin commented Aug 20, 2019

This commit adds the feature to add locale to both isAlpha and isAlphanumeric with default as en-US

@@ -495,16 +495,16 @@ export class Validator {
* Checks if the string contains only letters (a-zA-Z).
* If given value is not a string, then it returns false.
*/
isAlpha(value: string): boolean {
return typeof value === "string" && this.validatorJs.isAlpha(value);
isAlpha(value: string, locale: ValidatorJS.AlphaLocale = "en-US"): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave locale parameter without default value. validator.js lib will use "en-US" by default. Same for isAlphanumeric.

@vlapo vlapo changed the title added locale for isAlpha and isAlphanumeric with tests fix: add locale parameter for isAlpha and isAlphanumeric validators Aug 20, 2019
@rubiin
Copy link
Contributor Author

rubiin commented Aug 20, 2019

will do

@rubiin
Copy link
Contributor Author

rubiin commented Aug 20, 2019

I have also fixed the number options on the isnumeric string on the same pr

@rubiin
Copy link
Contributor Author

rubiin commented Aug 26, 2019

@vlapo I have addressed your changes.

@vlapo vlapo merged commit 2f4bf4e into typestack:master Sep 24, 2019
@vlapo
Copy link
Contributor

vlapo commented Sep 24, 2019

Thank you for contribution.

@rubiin
Copy link
Contributor Author

rubiin commented Sep 25, 2019

Anytime

@github-actions
Copy link

github-actions bot commented Aug 4, 2020

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants