Skip to content

Commit

Permalink
feat(isMobilePhone): update zh-CN validation (#1174)
Browse files Browse the repository at this point in the history
  • Loading branch information
heathcliff-hu authored and profnandaa committed Oct 25, 2019
1 parent 2a80a4f commit 30e8dea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/isMobilePhone.js
Expand Up @@ -92,7 +92,7 @@ var phones = {
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)((3([2-9]))|(5([2689]))|(7([0|6-9]))|(8([1-6|89]))|(9([0-9])))([0-9]{7})$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|6[67]|7[0135678]|9[189])[0-9]{8}$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|6[67]|7[01235678]|9[189])[0-9]{8}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
};
/* eslint-enable max-len */
Expand Down
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Expand Up @@ -83,7 +83,7 @@ const phones = {
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)((3([2-9]))|(5([2689]))|(7([0|6-9]))|(8([1-6|89]))|(9([0-9])))([0-9]{7})$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|6[67]|7[0135678]|9[189])[0-9]{8}$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|6[67]|7[01235678]|9[189])[0-9]{8}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/,
};
/* eslint-enable max-len */
Expand Down
3 changes: 3 additions & 0 deletions test/validators.js
Expand Up @@ -4027,6 +4027,9 @@ describe('Validators', () => {
'+8619912341234',
'+8619812341234',
'+8619112341234',
'17269427292',
'+8617269427292',
'008617269427292',
],
invalid: [
'12345',
Expand Down
2 changes: 1 addition & 1 deletion validator.js
Expand Up @@ -1431,7 +1431,7 @@ var phones = {
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)((3([2-9]))|(5([2689]))|(7([0|6-9]))|(8([1-6|89]))|(9([0-9])))([0-9]{7})$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|6[67]|7[0135678]|9[189])[0-9]{8}$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|6[67]|7[01235678]|9[189])[0-9]{8}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
};
/* eslint-enable max-len */
Expand Down

0 comments on commit 30e8dea

Please sign in to comment.