Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso authored Jul 31, 2018
2 parents cfb2d87 + 5a216fc commit e08a11d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#### HEAD

- New locale
([#856](https://github.com/chriso/validator.js/pull/856))
- New and improved locales
([#856](https://github.com/chriso/validator.js/pull/856),
[#872](https://github.com/chriso/validator.js/pull/872))

#### 10.4.0

Expand Down
2 changes: 1 addition & 1 deletion lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var phones = {
'en-SG': /^(\+65)?[89]\d{7}$/,
'en-TZ': /^(\+?255|0)?[67]\d{8}$/,
'en-UG': /^(\+?256|0)?[7]\d{8}$/,
'en-US': /^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,
'en-US': /^(\+?1?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,
'en-ZA': /^(\+?27|0)\d{9}$/,
'en-ZM': /^(\+?26)?09[567]\d{7}$/,
'es-ES': /^(\+?34)?(6\d{1}|7[1234])\d{7}$/,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const phones = {
'en-SG': /^(\+65)?[89]\d{7}$/,
'en-TZ': /^(\+?255|0)?[67]\d{8}$/,
'en-UG': /^(\+?256|0)?[7]\d{8}$/,
'en-US': /^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,
'en-US': /^(\+?1?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,
'en-ZA': /^(\+?27|0)\d{9}$/,
'en-ZM': /^(\+?26)?09[567]\d{7}$/,
'es-ES': /^(\+?34)?(6\d{1}|7[1234])\d{7}$/,
Expand Down
21 changes: 10 additions & 11 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3583,34 +3583,33 @@ describe('Validators', () => {
'19876543210',
'8005552222',
'+15673628910',
'+1(567)3628910',
'+1(567)362-8910',
'+1(567) 362-8910',
'1(567)362-8910',
'1(567)362 8910',
'223-456-7890',
],
invalid: [
'564785',
'0123456789',
'1437439210',
'8009112340',
'+10345672645',
'11435213543',
'2436119753',
'16532116190',
'1(067)362-8910',
'1(167)362-8910',
'+2(267)362-8910',
],
},
{
locale: 'en-CA',
valid: [
'19876543210',
'8005552222',
'+15673628910',
],
valid: ['19876543210', '8005552222', '+15673628910'],
invalid: [
'564785',
'0123456789',
'1437439210',
'8009112340',
'+10345672645',
'11435213543',
'2436119753',
'16532116190',
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ var phones = {
'en-SG': /^(\+65)?[89]\d{7}$/,
'en-TZ': /^(\+?255|0)?[67]\d{8}$/,
'en-UG': /^(\+?256|0)?[7]\d{8}$/,
'en-US': /^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,
'en-US': /^(\+?1?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,
'en-ZA': /^(\+?27|0)\d{9}$/,
'en-ZM': /^(\+?26)?09[567]\d{7}$/,
'es-ES': /^(\+?34)?(6\d{1}|7[1234])\d{7}$/,
Expand Down
2 changes: 1 addition & 1 deletion validator.min.js

Large diffs are not rendered by default.

0 comments on commit e08a11d

Please sign in to comment.