Skip to content

Commit b82d4e1

Browse files
authored
feat:(isMobilePhone): add mobile number prefix 162 and 165 to zh-CN locale (#1695)
1 parent 2595554 commit b82d4e1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const phones = {
114114
'uk-UA': /^(\+?38|8)?0\d{9}$/,
115115
'uz-UZ': /^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,
116116
'vi-VN': /^(\+?84|0)((3([2-9]))|(5([2689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,
117-
'zh-CN': /^((\+|00)86)?1([3456789][0-9]|4[579]|6[67]|7[01235678]|9[012356789])[0-9]{8}$/,
117+
'zh-CN': /^((\+|00)86)?1([3456789][0-9]|4[579]|6[2567]|7[01235678]|9[012356789])[0-9]{8}$/,
118118
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/,
119119
};
120120
/* eslint-enable max-len */

test/validators.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5987,6 +5987,9 @@ describe('Validators', () => {
59875987
'16565600001',
59885988
'+8617269427292',
59895989
'008617269427292',
5990+
'16238234822',
5991+
'008616238234822',
5992+
'+8616238234822',
59905993
],
59915994
invalid: [
59925995
'12345',

0 commit comments

Comments
 (0)