Chore: Add validation for contact phone field (#2105)

This commit is contained in:
Nithin David Thomas 2021-04-16 18:48:13 +05:30 committed by GitHub
parent ce4ce3c86c
commit 98bfef026e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 8 deletions

View file

@ -0,0 +1,2 @@
export const isPhoneE164 = value => !!value.match(/^\+[1-9]\d{1,14}$/);
export const isPhoneE164OrEmpty = value => isPhoneE164(value) || value === '';