From cb69cb7a9f1b0918d5f9647b86d5079adeee09c0 Mon Sep 17 00:00:00 2001 From: Maximilian Krause Date: Tue, 12 Oct 2021 23:18:02 +0200 Subject: [PATCH] feat(isMobilePhone): add Guyana en-GY locale [chore] fixed merge conflicts in #1784 feat: (isMobilePhone) Add Guyana mobile phone validation Fix linter errors --- src/lib/isMobilePhone.js | 1 + test/validators.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index cc52cba9f..171805f37 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -35,6 +35,7 @@ const phones = { 'en-GB': /^(\+?44|0)7\d{9}$/, 'en-GG': /^(\+?44|0)1481\d{6}$/, 'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/, + 'en-GY': /^(\+592|0)6\d{6}$/, 'en-HK': /^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/, 'en-MO': /^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/, 'en-IE': /^(\+?353|0)8[356789]\d{7}$/, diff --git a/test/validators.js b/test/validators.js index 0170ab883..e3c53796e 100644 --- a/test/validators.js +++ b/test/validators.js @@ -6523,6 +6523,22 @@ describe('Validators', () => { '+233292345671', ], }, + { + locale: 'en-GY', + valid: [ + '+5926121234', + '06121234', + '06726381', + '+5926726381', + ], + invalid: [ + '5926121234', + '6121234', + '+592 6121234', + '05926121234', + '+592-6121234', + ], + }, { locale: 'en-HK', valid: [