Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

NishantJS
Copy link
Contributor

Added support for Indian license plate validation. Valid examples from Wikipedia:

MH 04 AZ 4562

MH : STATE_CODE
04 : DISTRICT_CODE
AZ : UNIQUE_LETTERS
4562 : UNIQUE_NUMBERING

Basically all options can be written with dash, with space or all together or without symbol.

@codecov
Copy link

codecov bot commented Mar 22, 2022

Codecov Report

Merging #1944 (a51103c) into master (c1b21a9) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #1944   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          102       102           
  Lines         2085      2099   +14     
  Branches       472       472           
=========================================
+ Hits          2085      2099   +14     
Impacted Files Coverage Δ
src/lib/isLicensePlate.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1b21a9...a51103c. Read the comment docs.

@NishantJS NishantJS changed the title en-IN and all india locale support for isLicensePlate feat(isLicensePlate): added License Plate Regex for en-IN and all Indian locale Mar 28, 2022
@rubiin rubiin merged commit 46118dc into validatorjs:master Jul 18, 2022
@rubiin
Copy link
Member

rubiin commented Jul 18, 2022

Thankyou for the contribution 🎉

'en-IN': str => /^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(str),
};

validators['hi-IN'] = validators['en-IN'];
Copy link
Member

Choose a reason for hiding this comment

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

nit: missed this review, perhaps this wasn't necessary. At some point, we actually contemplated to just use country-code only in the locales for stuff like license plates, that really don't depend on language per se.

@rubiin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.