feat(isAlpha, isAlphanumeric): add support for Indic locales (ta-IN, te-IN, kn-IN, ml-IN, gu-IN, pa-IN, or-IN) by avadootharajesh · Pull Request #2576 · validatorjs/validator.js
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for seven Indic languages (Tamil, Telugu, Kannada, Malayalam, Gujarati, Punjabi, and Odia) to the isAlpha and isAlphanumeric validator functions. The implementation includes Unicode character ranges for each language, appropriate decimal handling, and comprehensive test coverage.
- Adds Unicode regex patterns for seven Indic locales covering their respective character ranges
- Updates decimal and comma decimal configurations for the new locales
- Provides comprehensive test coverage with valid and invalid test cases for each language
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/lib/alpha.js | Adds Unicode regex patterns for Indic languages and updates decimal configurations |
| test/validators.test.js | Adds comprehensive test cases for all seven new Indic language validators |
| README.md | Updates documentation to include the new supported locales in isAlpha and isAlphanumeric descriptions |
Comments suppressed due to low confidence (1)
test/validators.test.js:1988
- The Bengali (bn-IN) locale is being tested but was not mentioned in the PR title or description as one of the new Indic locales being added. This test appears to be for an existing locale rather than a newly added one.
it('should validate Bengali alpha strings', () => {