Skip to content

Commit d006e08

Browse files
authored
fix(isMobilePhone): add support for new networks codes in GH (#1635)
1 parent c33fca6 commit d006e08

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const phones = {
3333
'en-AU': /^(\+?61|0)4\d{8}$/,
3434
'en-GB': /^(\+?44|0)7\d{9}$/,
3535
'en-GG': /^(\+?44|0)1481\d{6}$/,
36-
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28)\d{7}$/,
36+
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,
3737
'en-HK': /^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,
3838
'en-MO': /^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,
3939
'en-IE': /^(\+?353|0)8[356789]\d{7}$/,

test/validators.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6011,6 +6011,8 @@ describe('Validators', () => {
60116011
'+233562345671',
60126012
'+233232345671',
60136013
'+233282345671',
6014+
'+233592349493',
6015+
'0550298219',
60146016
],
60156017
invalid: [
60166018
'082123',

0 commit comments

Comments
 (0)