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
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 === '';