-
-
Notifications
You must be signed in to change notification settings - Fork 929
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(location): en_CA postcodes by state (#3057)
- Loading branch information
1 parent
cc7715b
commit b62c1b7
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// https://en.wikipedia.org/wiki/Postal_codes_in_Canada | ||
// The basic format is A1A 1A1 | ||
// First letter is province/territory-specific | ||
// Other letters do not allow D, F, I, O, Q, U | ||
const suffix = '[0-9][ABCEGHJ-NPRSTVW-Z] [0-9][ABCEGHJ-NPRSTVW-Z][0-9]'; | ||
|
||
export default { | ||
AB: `{{helpers.fromRegExp(T${suffix})}}`, // Alberta | ||
BC: `{{helpers.fromRegExp(V${suffix})}}`, // British Columbia | ||
MB: `{{helpers.fromRegExp(R${suffix})}}`, // Manitoba | ||
NB: `{{helpers.fromRegExp(E${suffix})}}`, // New Brunswick | ||
NL: `{{helpers.fromRegExp(A${suffix})}}`, // Newfoundland and Labrador | ||
NS: `{{helpers.fromRegExp(B${suffix})}}`, // Nova Scotia | ||
NT: `{{helpers.fromRegExp(X${suffix})}}`, // Northwest Territories | ||
NU: `{{helpers.fromRegExp(X${suffix})}}`, // Nunavut | ||
ON: `{{helpers.fromRegExp([KLMNP]${suffix})}}`, // Ontario | ||
PE: `{{helpers.fromRegExp(C${suffix})}}`, // Prince Edward Island | ||
QC: `{{helpers.fromRegExp([GHJ]${suffix})}}`, // Quebec | ||
SK: `{{helpers.fromRegExp(S${suffix})}}`, // Saskatchewan | ||
YT: `{{helpers.fromRegExp(Y${suffix})}}`, // Yukon | ||
}; |