Skip to content

Commit def7f3e

Browse files
NanaAb-116rubiin
andauthored
feat(isMobilePhone): update phone regex for Ghana en-GH (#2362)
Co-authored-by: Rubin Bhandari <[email protected]>
1 parent a066cd2 commit def7f3e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const phones = {
4141
'en-BS': /^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,
4242
'en-GB': /^(\+?44|0)7[1-9]\d{8}$/,
4343
'en-GG': /^(\+?44|0)1481\d{6}$/,
44-
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,
44+
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|53|28|55|59)\d{7}$/,
4545
'en-GY': /^(\+592|0)6\d{6}$/,
4646
'en-HK': /^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,
4747
'en-MO': /^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,

test/validators.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8053,6 +8053,7 @@ describe('Validators', () => {
80538053
'0502345671',
80548054
'0242345671',
80558055
'0542345671',
8056+
'0532345671',
80568057
'0272345671',
80578058
'0572345671',
80588059
'0262345671',
@@ -8063,6 +8064,7 @@ describe('Validators', () => {
80638064
'+233502345671',
80648065
'+233242345671',
80658066
'+233542345671',
8067+
'+233532345671',
80668068
'+233272345671',
80678069
'+233572345671',
80688070
'+233262345671',

0 commit comments

Comments
 (0)