Skip to content

Commit 2ca3b55

Browse files
committed
Add fr-CI mobile phone regex validation
1 parent 6f436be commit 2ca3b55

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/lib/isMobilePhone.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ const phones = {
101101
'fr-BF': /^(\+226|0)[67]\d{7}$/,
102102
'fr-BJ': /^(\+229)\d{8}$/,
103103
'fr-CD': /^(\+?243|0)?(8|9)\d{8}$/,
104+
'fr-CI': /^(\+225|0)(0[1]|05|07)\d{7}$/,
104105
'fr-CM': /^(\+?237)6[0-9]{8}$/,
105106
'fr-FR': /^(\+?33|0)[67]\d{8}$/,
106107
'fr-GF': /^(\+?594|0|00594)[67]\d{8}$/,

test/validators.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11033,6 +11033,22 @@ describe('Validators', () => {
1103311033
args: [],
1103411034
});
1103511035

11036+
// fr-CI (Ivory Coast - French)
11037+
test({
11038+
validator: 'isMobilePhone',
11039+
args: ['fr-CI'],
11040+
valid: [
11041+
'+2250512345678',
11042+
'+2250712345678',
11043+
'0512345678',
11044+
'0712345678',
11045+
],
11046+
invalid: [
11047+
'12345',
11048+
'+2259912345678',
11049+
'abcdefghij',
11050+
],
11051+
});
1103611052

1103711053
it('should error on invalid locale', () => {
1103811054
test({

0 commit comments

Comments
 (0)