Skip to content

Commit

Permalink
fix(isPostalCode): postal code validation fix for locale IN (#1152)
Browse files Browse the repository at this point in the history
* postal code validation fix for locale IN

* regex updated
  • Loading branch information
adityaraval authored and profnandaa committed Oct 13, 2019
1 parent 3087572 commit d18a8b8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/isPostalCode.js
Expand Up @@ -30,7 +30,7 @@ const patterns = {
ID: fiveDigit,
IE: /^[A-z]\d[\d|w]\s\w{4}$/i,
IL: fiveDigit,
IN: sixDigit,
IN: /^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,
IS: threeDigit,
IT: fiveDigit,
JP: /^\d{3}\-\d{4}$/,
Expand Down
23 changes: 23 additions & 0 deletions test/validators.js
Expand Up @@ -6743,6 +6743,29 @@ describe('Validators', () => {
'A65T F12',
],
},
{
locale: 'IN',
valid: [
'364240',
'360005',
],
invalid: [
'123',
'012345',
'011111',
'101123',
'291123',
'351123',
'541123',
'551123',
'651123',
'661123',
'861123',
'871123',
'881123',
'891123',
],
},
{
locale: 'BG',
valid: [
Expand Down

0 comments on commit d18a8b8

Please sign in to comment.