validatorjs / validator.js

String validation
MIT License
23.12k stars 2.32k forks source link

Kyrgyzstan phone numbers are missing #1911

Closed DumDumich closed 1 year ago

DumDumich commented 2 years ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch validator@13.7.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/validator/lib/isMobilePhone.js b/node_modules/validator/lib/isMobilePhone.js
index a349f06..5e1831b 100644
--- a/node_modules/validator/lib/isMobilePhone.js
+++ b/node_modules/validator/lib/isMobilePhone.js
@@ -111,6 +111,7 @@ var phones = {
   'kk-KZ': /^(\+?7|8)?7\d{9}$/,
   'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
   'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
+  'ky-KG': /^(\+?996|0)\d{9}$/,
   'lt-LT': /^(\+370|8)\d{8}$/,
   'lv-LV': /^(\+?371)2\d{7}$/,
   'ms-MY': /^(\+?6?01){1}(([0145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,

This issue body was partially generated by patch-package.

WikiRik commented 2 years ago

Feel free to make a PR for this, including some tests

pano9000 commented 1 year ago

closing this, as this has been added with commit https://github.com/validatorjs/validator.js/commit/c8c247cc067a552f89e8a506d9e32ff4a9a71226 / #1924