From 63e30603c34afbebe0f705e716e6e46ef82c132a Mon Sep 17 00:00:00 2001 From: Li Liwei Date: Wed, 6 Jan 2021 12:58:24 +0800 Subject: [PATCH] fix: update isMobilePhone validation for en-SG --- src/lib/isMobilePhone.js | 2 +- test/validators.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index c34d45dfb..5b3e3a990 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -46,7 +46,7 @@ const phones = { 'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/, 'en-PH': /^(09|\+639)\d{9}$/, 'en-RW': /^(\+?250|0)?[7]\d{8}$/, - 'en-SG': /^(\+65)?[689]\d{7}$/, + 'en-SG': /^(\+65)?[3689]\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 baeca631a..5f3aef76f 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6161,6 +6161,7 @@ describe('Validators', () => { { locale: 'en-SG', valid: [ + '32891278', '87654321', '98765432', '+6587654321', @@ -6168,6 +6169,7 @@ describe('Validators', () => { '+6565241234', ], invalid: [ + '332891231', '987654321', '876543219', '8765432',