Skip to content

Commit b77fcea

Browse files
committed
fix: phone number for sri lanka - enhancement
1 parent 13651ea commit b77fcea

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const phones = {
104104
'pt-AO': /^(\+244)\d{9}$/,
105105
'ro-RO': /^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,
106106
'ru-RU': /^(\+?7|8)?9\d{9}$/,
107-
'si-LK': /^(?:0|94|\+94)?(7(0|1|2|5|6|7|8)( |-)?\d)\d{6}$/,
107+
'si-LK': /^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,
108108
'sl-SI': /^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,
109109
'sk-SK': /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
110110
'sq-AL': /^(\+355|0)6[789]\d{6}$/,

test/validators.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6759,14 +6759,13 @@ describe('Validators', () => {
67596759
'0786642116',
67606760
'078 7642116',
67616761
'078-7642116',
6762-
6762+
'0749994567',
67636763
],
67646764
invalid: [
67656765
'9912349956789',
67666766
'12345',
67676767
'1678123456',
67686768
'0731234567',
6769-
'0749994567',
67706769
'0797878674',
67716770
],
67726771
},

0 commit comments

Comments
 (0)