Skip to content

Commit

Permalink
feat(isMobilePhone): add Guernsey locale (#1092)
Browse files Browse the repository at this point in the history
  • Loading branch information
austenpayan authored and profnandaa committed Aug 20, 2019
1 parent 23fcd9c commit a4ca952
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/isMobilePhone.js
Expand Up @@ -32,6 +32,7 @@ var phones = {
'el-GR': /^(\+?30|0)?(69\d{8})$/,
'en-AU': /^(\+?61|0)4\d{8}$/,
'en-GB': /^(\+?44|0)7\d{9}$/,
'en-GG': /^(\+?44|0)1481\d{6}$/,
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28)\d{7}$/,
'en-HK': /^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,
'en-IE': /^(\+?353|0)8[356789]\d{7}$/,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -69,4 +69,4 @@
"node": ">= 0.10"
},
"license": "MIT"
}
}
1 change: 1 addition & 0 deletions src/lib/isMobilePhone.js
Expand Up @@ -22,6 +22,7 @@ const phones = {
'el-GR': /^(\+?30|0)?(69\d{8})$/,
'en-AU': /^(\+?61|0)4\d{8}$/,
'en-GB': /^(\+?44|0)7\d{9}$/,
'en-GG': /^(\+?44|0)1481\d{6}$/,
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28)\d{7}$/,
'en-HK': /^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,
'en-IE': /^(\+?353|0)8[356789]\d{7}$/,
Expand Down
14 changes: 14 additions & 0 deletions test/validators.js
Expand Up @@ -3981,6 +3981,20 @@ describe('Validators', () => {
'04123456789',
],
},
{
locale: 'en-GG',
valid: [
'+441481123456',
'+441481789123',
'441481123456',
'441481789123',
],
invalid: [
'999',
'+441481123456789',
'+447123456789',
],
},
{
locale: 'en-GH',
valid: [
Expand Down
1 change: 1 addition & 0 deletions validator.js
Expand Up @@ -1369,6 +1369,7 @@ var phones = {
'el-GR': /^(\+?30|0)?(69\d{8})$/,
'en-AU': /^(\+?61|0)4\d{8}$/,
'en-GB': /^(\+?44|0)7\d{9}$/,
'en-GG': /^(\+?44|0)1481\d{6}$/,
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28)\d{7}$/,
'en-HK': /^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,
'en-IE': /^(\+?353|0)8[356789]\d{7}$/,
Expand Down
2 changes: 1 addition & 1 deletion validator.min.js

Large diffs are not rendered by default.

0 comments on commit a4ca952

Please sign in to comment.