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 validatorjs#1014
  • Loading branch information
ezkemboi committed Aug 11, 2019
2 parents 98b2ca6 + 1be6b83 commit 94c80ae
Show file tree
Hide file tree
Showing 5 changed files with 393 additions and 1,286 deletions.
2 changes: 1 addition & 1 deletion lib/isPostalCode.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 94c80ae

Please sign in to comment.