/**
 * Helper function that checks if string is an email and it is valid
 * The default validation function for email fields if none is provided
 * @param str the email string to validate
 * @returns boolean true if valid email
 */
export function validateEmail(str: string) {
  const emailFormat = /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/;
  if (str.match(emailFormat)) {
    return true;
  }
  return false;
}
