-
Notifications
You must be signed in to change notification settings - Fork 809
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
Conversation
src/validation/Validator.ts
Outdated
@@ -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 { |
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.
Please leave locale parameter without default value. validator.js
lib will use "en-US" by default. Same for isAlphanumeric.
will do |
I have also fixed the number options on the isnumeric string on the same pr |
@vlapo I have addressed your changes. |
Thank you for contribution. |
Anytime |
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. |
This commit adds the feature to add locale to both isAlpha and isAlphanumeric with default as en-US