Skip to content

Commit

Permalink
Merge pull request #768 from seentaoInternetOrganization/master
Browse files Browse the repository at this point in the history
Hi,isMobilePhone need support 166 section with locale of 'zh-CN'
  • Loading branch information
chriso authored Jan 26, 2018
2 parents e241676 + 45cbe32 commit 121e44e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var phones = {
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
'zh-CN': /^(\+?0?86\-?)?1[345789]\d{9}$/,
'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
};
/* eslint-enable max-len */
Expand Down
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const phones = {
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
'zh-CN': /^(\+?0?86\-?)?1[345789]\d{9}$/,
'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/,
};
/* eslint-enable max-len */
Expand Down
3 changes: 3 additions & 0 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3128,6 +3128,9 @@ describe('Validators', function () {
'08613487234567',
'8617823492338',
'86-17823492338',
'16637108167',
'86-16637108167',
'+086-16637108167',
],
invalid: [
'12345',
Expand Down
2 changes: 1 addition & 1 deletion validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ var phones = {
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
'zh-CN': /^(\+?0?86\-?)?1[345789]\d{9}$/,
'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
};
/* eslint-enable max-len */
Expand Down
2 changes: 1 addition & 1 deletion validator.min.js

Large diffs are not rendered by default.

0 comments on commit 121e44e

Please sign in to comment.