Skip to content

Commit

Permalink
fix(clean): clean work on BR postal code
Browse files Browse the repository at this point in the history
- fix issues relating to BR postal code
- add more tests
- closes #1014
  • Loading branch information
ezkemboi committed Aug 11, 2019
2 parents 98b2ca6 + 1be6b83 commit aa26332
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/isPostalCode.js
Expand Up @@ -21,7 +21,7 @@ var patterns = {
AU: fourDigit,
BE: fourDigit,
BG: fourDigit,
BR: /^\d{5}-\d{3}$/,
BR: /^\d{5}[-|\.|]?\d{3}$/,
CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
CH: fourDigit,
CZ: /^\d{3}\s?\d{2}$/,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/isPostalCode.js
Expand Up @@ -12,7 +12,7 @@ const patterns = {
AU: fourDigit,
BE: fourDigit,
BG: fourDigit,
BR: /^\d{5}-\d{3}$/,
BR: /^\d{5}[-|\.|]?\d{3}$/,
CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
CH: fourDigit,
CZ: /^\d{3}\s?\d{2}$/,
Expand Down
1 change: 1 addition & 0 deletions test/validators.js
Expand Up @@ -6718,6 +6718,7 @@ describe('Validators', () => {
'39100-000',
'22040-020',
'39400-152',
'13010|111',
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion validator.js
Expand Up @@ -1753,7 +1753,7 @@ var patterns = {
AU: fourDigit,
BE: fourDigit,
BG: fourDigit,
BR: /^\d{5}-\d{3}$/,
BR: /^\d{5}[-|\.|]?\d{3}$/,
CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
CH: fourDigit,
CZ: /^\d{3}\s?\d{2}$/,
Expand Down
2 changes: 1 addition & 1 deletion validator.min.js

Large diffs are not rendered by default.

0 comments on commit aa26332

Please sign in to comment.