Skip to content

feat(isAlpha, isAlphanumeric): add support for Indic locales (ta-IN, te-IN, kn-IN, ml-IN, gu-IN, pa-IN, or-IN) #2576

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

avadootharajesh
Copy link

This commit introduces Indic language support into isAlpha and isAlphanumeric methods.

Languages added:

Test Result

Screenshot 2025-07-20 132235

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

Copy link

codecov bot commented Jul 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (72573b3) to head (c458883).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2576   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2535      2539    +4     
  Branches       641       641           
=========================================
+ Hits          2535      2539    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avadootharajesh
Copy link
Author

Hey reviewer!

  • Added support for Indian languages 🎉
  • Added basic support for Indian languages in the validator.
  • Tested a few cases, things look good. Open to feedback!

let me know If I have to do anything else...

@rubiin rubiin requested a review from Copilot July 20, 2025 08:55
Copy link

@Copilot Copilot AI left a comment

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', () => {

@avadootharajesh
Copy link
Author

avadootharajesh commented Jul 21, 2025

Are there any other issues?
Cuz bengali test was added by someone else, hence I have mentioned what I have done
As it ( bengali ) is existing, I did not take a step to change it Or fakely add it to my pr
@Copilot @rubiin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant