From 0ad2afee9c99e0f76cfc84ef963e8983df70d9d6 Mon Sep 17 00:00:00 2001 From: Where Date: Fri, 25 Oct 2019 19:12:08 +0800 Subject: [PATCH 1/2] Update '"zh-CN"' The prefix '+' and '00' of 'zh-CN' are not required --- src/lib/isMobilePhone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index eaa26d9ce..badc5aa73 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -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[0135678]|9[189])[0-9]{8}$/, 'zh-TW': /^(\+?886\-?|0)?9\d{8}$/, }; /* eslint-enable max-len */ From 18ff97ea170f23a575e6ecc6bde7dcfa1a9246fe Mon Sep 17 00:00:00 2001 From: Where Date: Sat, 26 Oct 2019 00:27:22 +0800 Subject: [PATCH 2/2] fix(IsMobilePhone): Add some test --- test/validators.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/validators.js b/test/validators.js index e86c36201..62cd9511c 100644 --- a/test/validators.js +++ b/test/validators.js @@ -4027,6 +4027,7 @@ describe('Validators', () => { '+8619912341234', '+8619812341234', '+8619112341234', + '8615663582068', ], invalid: [ '12345',