From b77fcea4799dfae0ee79fefd3eeef1ba259f3722 Mon Sep 17 00:00:00 2001 From: Madhavi96 Date: Wed, 13 Oct 2021 09:41:10 +0530 Subject: [PATCH] fix: phone number for sri lanka - enhancement --- 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 8b56b769f..32c00df38 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -104,7 +104,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 91794d521..2f033a461 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6759,14 +6759,13 @@ describe('Validators', () => { '0786642116', '078 7642116', '078-7642116', - + '0749994567', ], invalid: [ '9912349956789', '12345', '1678123456', '0731234567', - '0749994567', '0797878674', ], },