From cf74b9a1fc52c33e53fa537ab78f9f3cfd997bb1 Mon Sep 17 00:00:00 2001 From: Chung Wei Date: Sun, 31 May 2020 01:56:05 +0800 Subject: [PATCH] fix(isMobilePhone): add support for en-SG +656 --- src/lib/isMobilePhone.js | 2 +- test/validators.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index 61cefcc1c..5243a4fc5 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -38,7 +38,7 @@ const phones = { 'en-NZ': /^(\+?64|0)[28]\d{7,9}$/, 'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/, 'en-RW': /^(\+?250|0)?[7]\d{8}$/, - 'en-SG': /^(\+65)?[89]\d{7}$/, + 'en-SG': /^(\+65)?[689]\d{7}$/, 'en-SL': /^(?:0|94|\+94)?(7(0|1|2|5|6|7|8)( |-)?\d)\d{6}$/, 'en-TZ': /^(\+?255|0)?[67]\d{8}$/, 'en-UG': /^(\+?256|0)?[7]\d{8}$/, diff --git a/test/validators.js b/test/validators.js index 0caf824fd..9f92ddd8d 100755 --- a/test/validators.js +++ b/test/validators.js @@ -5512,6 +5512,7 @@ describe('Validators', () => { '98765432', '+6587654321', '+6598765432', + '+6565241234', ], invalid: [ '987654321',