Skip to content

Commit 121e44e

Browse files
authored
Merge pull request #768 from seentaoInternetOrganization/master
Hi,isMobilePhone need support 166 section with locale of 'zh-CN'
2 parents e241676 + 45cbe32 commit 121e44e

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ var phones = {
6666
'tr-TR': /^(\+?90|0)?5\d{9}$/,
6767
'uk-UA': /^(\+?38|8)?0\d{9}$/,
6868
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
69-
'zh-CN': /^(\+?0?86\-?)?1[345789]\d{9}$/,
69+
'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
7070
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
7171
};
7272
/* eslint-enable max-len */

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const phones = {
5555
'tr-TR': /^(\+?90|0)?5\d{9}$/,
5656
'uk-UA': /^(\+?38|8)?0\d{9}$/,
5757
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
58-
'zh-CN': /^(\+?0?86\-?)?1[345789]\d{9}$/,
58+
'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
5959
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/,
6060
};
6161
/* eslint-enable max-len */

test/validators.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3128,6 +3128,9 @@ describe('Validators', function () {
31283128
'08613487234567',
31293129
'8617823492338',
31303130
'86-17823492338',
3131+
'16637108167',
3132+
'86-16637108167',
3133+
'+086-16637108167',
31313134
],
31323135
invalid: [
31333136
'12345',

validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ var phones = {
10171017
'tr-TR': /^(\+?90|0)?5\d{9}$/,
10181018
'uk-UA': /^(\+?38|8)?0\d{9}$/,
10191019
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
1020-
'zh-CN': /^(\+?0?86\-?)?1[345789]\d{9}$/,
1020+
'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
10211021
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
10221022
};
10231023
/* eslint-enable max-len */

validator.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)