From 15afc77850ad401638a4fbc2fe450eac94c5500d Mon Sep 17 00:00:00 2001 From: Ishara Madhavi Date: Sat, 30 Oct 2021 11:59:28 +0530 Subject: [PATCH] fix(isMobilePhone): update Sri Lanka locale (#1785) --- src/lib/isMobilePhone.js | 2 +- test/validators.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index d100d9823..340c12a08 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -106,7 +106,7 @@ const phones = { 'pt-AO': /^(\+244)\d{9}$/, 'ro-RO': /^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/, 'ru-RU': /^(\+?7|8)?9\d{9}$/, - 'si-LK': /^(?:0|94|\+94)?(7(0|1|2|5|6|7|8)( |-)?\d)\d{6}$/, + 'si-LK': /^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/, 'sl-SI': /^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/, 'sk-SK': /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/, 'sq-AL': /^(\+355|0)6[789]\d{6}$/, diff --git a/test/validators.js b/test/validators.js index 1dcd439ae..44e688beb 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6841,14 +6841,13 @@ describe('Validators', () => { '0786642116', '078 7642116', '078-7642116', - + '0749994567', ], invalid: [ '9912349956789', '12345', '1678123456', '0731234567', - '0749994567', '0797878674', ], },