From 0b3515862a3f9662ab07676465dab5caf2c9c2a6 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 14:50:41 +0530 Subject: [PATCH 01/13] Update isMobilePhone.js --- src/lib/isMobilePhone.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index 575415e27..5f544be7a 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -44,6 +44,7 @@ const phones = { 'en-IN': /^(\+?91|0)?[6789]\d{9}$/, 'en-KE': /^(\+?254|0)(7|1)\d{8}$/, 'en-KI': /^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/, + 'en-LS': /^(\+266)\d{8}$/, 'en-MT': /^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/, 'en-MU': /^(\+?230|0)?\d{8}$/, 'en-NA': /^(\+?264|0)(6|8)\d{7}$/, From f0952a51bedfc8961ab4eebfd0487b5ddb39d0a2 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 14:51:25 +0530 Subject: [PATCH 02/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d2ed2bce..0116ef43d 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ Validator | Description **isMagnetURI(str)** | check if the string is a [magnet uri format](https://en.wikipedia.org/wiki/Magnet_URI_scheme). **isMD5(str)** | check if the string is a MD5 hash.

Please note that you can also use the `isHash(str, 'md5')` function. Keep in mind that MD5 has some collision weaknesses compared to other algorithms (e.g., SHA). **isMimeType(str)** | check if the string matches to a valid [MIME type](https://en.wikipedia.org/wiki/Media_type) format -**isMobilePhone(str [, locale [, options]])** | check if the string is a mobile phone number,

(locale is either an array of locales (e.g `['sk-SK', 'sr-RS']`) OR one of `['am-Am', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', ar-JO', 'ar-KW', 'ar-PS', 'ar-SA', 'ar-SY', 'ar-TN', 'az-AZ', 'az-LY', 'az-LB', 'bs-BA', 'be-BY', 'bg-BG', 'bn-BD', 'ca-AD', 'cs-CZ', 'da-DK', 'de-DE', 'de-AT', 'de-CH', 'de-LU', 'dv-MV', 'el-GR', 'en-AU', 'en-BM', 'en-BW', 'en-CA', 'en-GB', 'en-GG', 'en-GH', 'en-GY', 'en-HK', 'en-MO', 'en-IE', 'en-IN', 'en-KE', 'en-KI', 'en-MT', 'en-MU', 'en-NG', 'en-NZ', 'en-PK', 'en-PH', 'en-RW', 'en-SG', 'en-SL', 'en-UG', 'en-US', 'en-TZ', 'en-ZA', 'en-ZM', 'en-ZW', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-HN', 'es-PE', 'es-EC', 'es-ES', 'es-MX', 'es-PA', 'es-PY', 'es-SV', 'es-UY', 'es-VE', 'et-EE', 'fa-IR', 'fi-FI', 'fj-FJ', 'fo-FO', 'fr-BE', 'fr-BF', 'fr-FR', 'fr-GF', 'fr-GP', 'fr-MQ', 'fr-PF', 'fr-RE', 'ga-IE', 'he-IL', 'hu-HU', 'id-ID', 'it-IT', 'it-SM', 'ja-JP', 'ka-GE', 'kk-KZ', 'kl-GL', 'ko-KR', 'lt-LT', 'ms-MY', 'my-MM', 'mz-MZ', nb-NO', 'ne-NP', 'nl-BE', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'pt-AO', 'ro-RO', 'ru-RU', 'si-LK' 'sl-SI', 'sk-SK', 'sq-AL', 'sr-RS', 'sv-SE', 'tg-TJ', 'th-TH', 'tk-TM', 'tr-TR', 'uk-UA', 'uz-UZ', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-MO', 'zh-TW', 'dz-BT']` OR defaults to 'any'. If 'any' or a falsey value is used, function will check if any of the locales match).

`options` is an optional object that can be supplied with the following keys: `strictMode`, if this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`. Locale list is `validator.isMobilePhoneLocales`. +**isMobilePhone(str [, locale [, options]])** | check if the string is a mobile phone number,

(locale is either an array of locales (e.g `['sk-SK', 'sr-RS']`) OR one of `['am-Am', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', ar-JO', 'ar-KW', 'ar-PS', 'ar-SA', 'ar-SY', 'ar-TN', 'az-AZ', 'az-LY', 'az-LB', 'bs-BA', 'be-BY', 'bg-BG', 'bn-BD', 'ca-AD', 'cs-CZ', 'da-DK', 'de-DE', 'de-AT', 'de-CH', 'de-LU', 'dv-MV', 'el-GR', 'en-AU', 'en-BM', 'en-BW', 'en-CA', 'en-GB', 'en-GG', 'en-GH', 'en-GY', 'en-HK', 'en-MO', 'en-IE', 'en-IN','en-LS', 'en-KE', 'en-KI', 'en-MT', 'en-MU', 'en-NG', 'en-NZ', 'en-PK', 'en-PH', 'en-RW', 'en-SG', 'en-SL', 'en-UG', 'en-US', 'en-TZ', 'en-ZA', 'en-ZM', 'en-ZW', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-HN', 'es-PE', 'es-EC', 'es-ES', 'es-MX', 'es-PA', 'es-PY', 'es-SV', 'es-UY', 'es-VE', 'et-EE', 'fa-IR', 'fi-FI', 'fj-FJ', 'fo-FO', 'fr-BE', 'fr-BF', 'fr-FR', 'fr-GF', 'fr-GP', 'fr-MQ', 'fr-PF', 'fr-RE', 'ga-IE', 'he-IL', 'hu-HU', 'id-ID', 'it-IT', 'it-SM', 'ja-JP', 'ka-GE', 'kk-KZ', 'kl-GL', 'ko-KR', 'lt-LT', 'ms-MY', 'my-MM', 'mz-MZ', nb-NO', 'ne-NP', 'nl-BE', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'pt-AO', 'ro-RO', 'ru-RU', 'si-LK' 'sl-SI', 'sk-SK', 'sq-AL', 'sr-RS', 'sv-SE', 'tg-TJ', 'th-TH', 'tk-TM', 'tr-TR', 'uk-UA', 'uz-UZ', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-MO', 'zh-TW', 'dz-BT']` OR defaults to 'any'. If 'any' or a falsey value is used, function will check if any of the locales match).

`options` is an optional object that can be supplied with the following keys: `strictMode`, if this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`. Locale list is `validator.isMobilePhoneLocales`. **isMongoId(str)** | check if the string is a valid hex-encoded representation of a [MongoDB ObjectId][mongoid]. **isMultibyte(str)** | check if the string contains one or more multibyte chars. **isNumeric(str [, options])** | check if the string contains only numbers.

`options` is an object which defaults to `{no_symbols: false}` it also has locale as an option. If `no_symbols` is true, the validator will reject numeric strings that feature a symbol (e.g. `+`, `-`, or `.`).

`locale` determine the decimal separator and is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fr-FR', 'fr-CA', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']`. From f6977718c52c89df0c9370109796ca0be29153d4 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 15:02:40 +0530 Subject: [PATCH 03/13] Update isMobilePhone.js --- src/lib/isMobilePhone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index 5f544be7a..ffafbe4d5 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -44,7 +44,7 @@ const phones = { 'en-IN': /^(\+?91|0)?[6789]\d{9}$/, 'en-KE': /^(\+?254|0)(7|1)\d{8}$/, 'en-KI': /^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/, - 'en-LS': /^(\+266)\d{8}$/, + 'en-LS': /^(\+266)?(22|28|57|58|59|27|52)\d{6}$/, 'en-MT': /^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/, 'en-MU': /^(\+?230|0)?\d{8}$/, 'en-NA': /^(\+?264|0)(6|8)\d{7}$/, From 0575a44e5f39a043dce48fcf5b558c6db4a0f4f9 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 15:10:53 +0530 Subject: [PATCH 04/13] Update validators.js --- test/validators.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/validators.js b/test/validators.js index 76ec3d95a..54407dcfe 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6550,6 +6550,22 @@ describe('Validators', () => { '0-987123456', ], }, + { + local:'en-LS', + valid:[ + '+26622123456', + '+26628123456', + '+26657123456', + '+26658123456', + '+26659123456', + '+26627123456', + '+26652123456', + ], + invalid:[ + '+26612345678', + '', + '2224512', + } { locale: 'en-BM', valid: [ From 5eac457bc040c5d7b28b6a8151536b6475d9d840 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 15:19:12 +0530 Subject: [PATCH 05/13] Update validators.js --- test/validators.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/validators.js b/test/validators.js index 54407dcfe..f60040cc6 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6565,7 +6565,8 @@ describe('Validators', () => { '+26612345678', '', '2224512', - } + ], + }, { locale: 'en-BM', valid: [ From 03eaa2a39937a6d61582bbcacdad34d1a31d9a5c Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 15:22:36 +0530 Subject: [PATCH 06/13] Update validators.js --- test/validators.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/validators.js b/test/validators.js index f60040cc6..eeb8a1f88 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6551,8 +6551,8 @@ describe('Validators', () => { ], }, { - local:'en-LS', - valid:[ + local: 'en-LS', + valid: [ '+26622123456', '+26628123456', '+26657123456', @@ -6560,12 +6560,12 @@ describe('Validators', () => { '+26659123456', '+26627123456', '+26652123456', - ], - invalid:[ + ], + invalid: [ '+26612345678', '', '2224512', - ], + ], }, { locale: 'en-BM', From 327c80769958c610dee84026c921c20752e4e797 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 15:25:15 +0530 Subject: [PATCH 07/13] Update validators.js --- test/validators.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/validators.js b/test/validators.js index eeb8a1f88..29d39069f 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6560,12 +6560,12 @@ describe('Validators', () => { '+26659123456', '+26627123456', '+26652123456', - ], + ], invalid: [ '+26612345678', '', '2224512', - ], + ], }, { locale: 'en-BM', From f61fb616d60fea32855add680e930b4b6469e415 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 15:29:37 +0530 Subject: [PATCH 08/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0116ef43d..52b4a0ac3 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ Validator | Description **isMagnetURI(str)** | check if the string is a [magnet uri format](https://en.wikipedia.org/wiki/Magnet_URI_scheme). **isMD5(str)** | check if the string is a MD5 hash.

Please note that you can also use the `isHash(str, 'md5')` function. Keep in mind that MD5 has some collision weaknesses compared to other algorithms (e.g., SHA). **isMimeType(str)** | check if the string matches to a valid [MIME type](https://en.wikipedia.org/wiki/Media_type) format -**isMobilePhone(str [, locale [, options]])** | check if the string is a mobile phone number,

(locale is either an array of locales (e.g `['sk-SK', 'sr-RS']`) OR one of `['am-Am', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', ar-JO', 'ar-KW', 'ar-PS', 'ar-SA', 'ar-SY', 'ar-TN', 'az-AZ', 'az-LY', 'az-LB', 'bs-BA', 'be-BY', 'bg-BG', 'bn-BD', 'ca-AD', 'cs-CZ', 'da-DK', 'de-DE', 'de-AT', 'de-CH', 'de-LU', 'dv-MV', 'el-GR', 'en-AU', 'en-BM', 'en-BW', 'en-CA', 'en-GB', 'en-GG', 'en-GH', 'en-GY', 'en-HK', 'en-MO', 'en-IE', 'en-IN','en-LS', 'en-KE', 'en-KI', 'en-MT', 'en-MU', 'en-NG', 'en-NZ', 'en-PK', 'en-PH', 'en-RW', 'en-SG', 'en-SL', 'en-UG', 'en-US', 'en-TZ', 'en-ZA', 'en-ZM', 'en-ZW', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-HN', 'es-PE', 'es-EC', 'es-ES', 'es-MX', 'es-PA', 'es-PY', 'es-SV', 'es-UY', 'es-VE', 'et-EE', 'fa-IR', 'fi-FI', 'fj-FJ', 'fo-FO', 'fr-BE', 'fr-BF', 'fr-FR', 'fr-GF', 'fr-GP', 'fr-MQ', 'fr-PF', 'fr-RE', 'ga-IE', 'he-IL', 'hu-HU', 'id-ID', 'it-IT', 'it-SM', 'ja-JP', 'ka-GE', 'kk-KZ', 'kl-GL', 'ko-KR', 'lt-LT', 'ms-MY', 'my-MM', 'mz-MZ', nb-NO', 'ne-NP', 'nl-BE', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'pt-AO', 'ro-RO', 'ru-RU', 'si-LK' 'sl-SI', 'sk-SK', 'sq-AL', 'sr-RS', 'sv-SE', 'tg-TJ', 'th-TH', 'tk-TM', 'tr-TR', 'uk-UA', 'uz-UZ', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-MO', 'zh-TW', 'dz-BT']` OR defaults to 'any'. If 'any' or a falsey value is used, function will check if any of the locales match).

`options` is an optional object that can be supplied with the following keys: `strictMode`, if this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`. Locale list is `validator.isMobilePhoneLocales`. +**isMobilePhone(str [, locale [, options]])** | check if the string is a mobile phone number,

(locale is either an array of locales (e.g `['sk-SK', 'sr-RS']`) OR one of `['am-Am', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', ar-JO', 'ar-KW', 'ar-PS', 'ar-SA', 'ar-SY', 'ar-TN', 'az-AZ', 'az-LY', 'az-LB', 'bs-BA', 'be-BY', 'bg-BG', 'bn-BD', 'ca-AD', 'cs-CZ', 'da-DK', 'de-DE', 'de-AT', 'de-CH', 'de-LU', 'dv-MV', 'el-GR', 'en-AU', 'en-BM', 'en-BW', 'en-CA', 'en-GB', 'en-GG', 'en-GH', 'en-GY', 'en-HK', 'en-MO', 'en-IE', 'en-IN', 'en-LS', 'en-KE', 'en-KI', 'en-MT', 'en-MU', 'en-NG', 'en-NZ', 'en-PK', 'en-PH', 'en-RW', 'en-SG', 'en-SL', 'en-UG', 'en-US', 'en-TZ', 'en-ZA', 'en-ZM', 'en-ZW', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-HN', 'es-PE', 'es-EC', 'es-ES', 'es-MX', 'es-PA', 'es-PY', 'es-SV', 'es-UY', 'es-VE', 'et-EE', 'fa-IR', 'fi-FI', 'fj-FJ', 'fo-FO', 'fr-BE', 'fr-BF', 'fr-FR', 'fr-GF', 'fr-GP', 'fr-MQ', 'fr-PF', 'fr-RE', 'ga-IE', 'he-IL', 'hu-HU', 'id-ID', 'it-IT', 'it-SM', 'ja-JP', 'ka-GE', 'kk-KZ', 'kl-GL', 'ko-KR', 'lt-LT', 'ms-MY', 'my-MM', 'mz-MZ', nb-NO', 'ne-NP', 'nl-BE', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'pt-AO', 'ro-RO', 'ru-RU', 'si-LK' 'sl-SI', 'sk-SK', 'sq-AL', 'sr-RS', 'sv-SE', 'tg-TJ', 'th-TH', 'tk-TM', 'tr-TR', 'uk-UA', 'uz-UZ', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-MO', 'zh-TW', 'dz-BT']` OR defaults to 'any'. If 'any' or a falsey value is used, function will check if any of the locales match).

`options` is an optional object that can be supplied with the following keys: `strictMode`, if this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`. Locale list is `validator.isMobilePhoneLocales`. **isMongoId(str)** | check if the string is a valid hex-encoded representation of a [MongoDB ObjectId][mongoid]. **isMultibyte(str)** | check if the string contains one or more multibyte chars. **isNumeric(str [, options])** | check if the string contains only numbers.

`options` is an object which defaults to `{no_symbols: false}` it also has locale as an option. If `no_symbols` is true, the validator will reject numeric strings that feature a symbol (e.g. `+`, `-`, or `.`).

`locale` determine the decimal separator and is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fr-FR', 'fr-CA', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']`. From 8a0563aa96e23d24e76c1a0f700ef9f317bade81 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 23:41:21 +0530 Subject: [PATCH 09/13] Update isMobilePhone.js --- src/lib/isMobilePhone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index ffafbe4d5..fa8b27e44 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -44,7 +44,7 @@ const phones = { 'en-IN': /^(\+?91|0)?[6789]\d{9}$/, 'en-KE': /^(\+?254|0)(7|1)\d{8}$/, 'en-KI': /^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/, - 'en-LS': /^(\+266)?(22|28|57|58|59|27|52)\d{6}$/, + 'en-LS': /^(\+266)(22|28|57|58|59|27|52)\d{6}$/, 'en-MT': /^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/, 'en-MU': /^(\+?230|0)?\d{8}$/, 'en-NA': /^(\+?264|0)(6|8)\d{7}$/, From 5d3a74292aa4f627dc75c2d65f07a8c54c2558d5 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 23:42:46 +0530 Subject: [PATCH 10/13] Update validators.js --- test/validators.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/validators.js b/test/validators.js index 29d39069f..196339cf6 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6565,6 +6565,8 @@ describe('Validators', () => { '+26612345678', '', '2224512', + '+2662212345678' + 'someString', ], }, { From c1a15887f698b725f3f1ddf964a36eceea562142 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 23:45:24 +0530 Subject: [PATCH 11/13] Update validators.js --- test/validators.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validators.js b/test/validators.js index 196339cf6..171fd4f13 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6565,7 +6565,7 @@ describe('Validators', () => { '+26612345678', '', '2224512', - '+2662212345678' + '+2662212345678', 'someString', ], }, From a78484f245fc9a369f5a2b6de63bc41217a31906 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Wed, 19 Jan 2022 23:48:39 +0530 Subject: [PATCH 12/13] Update isMobilePhone.js --- src/lib/isMobilePhone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index fa8b27e44..f3a49d99a 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -44,7 +44,7 @@ const phones = { 'en-IN': /^(\+?91|0)?[6789]\d{9}$/, 'en-KE': /^(\+?254|0)(7|1)\d{8}$/, 'en-KI': /^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/, - 'en-LS': /^(\+266)(22|28|57|58|59|27|52)\d{6}$/, + 'en-LS': /^(\+?266)(22|28|57|58|59|27|52)\d{6}$/, 'en-MT': /^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/, 'en-MU': /^(\+?230|0)?\d{8}$/, 'en-NA': /^(\+?264|0)(6|8)\d{7}$/, From 934fce00c38b1dda5d836927081d08833ef9a1b6 Mon Sep 17 00:00:00 2001 From: Bhuvnesh Sharma <83907321+Bhuvnesh875@users.noreply.github.com> Date: Thu, 20 Jan 2022 00:23:32 +0530 Subject: [PATCH 13/13] Update validators.js --- test/validators.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validators.js b/test/validators.js index 171fd4f13..f5910448c 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6564,7 +6564,7 @@ describe('Validators', () => { invalid: [ '+26612345678', '', - '2224512', + '2664512-21', '+2662212345678', 'someString', ],