{"size": 781, "ext": "js", "max_stars_repo_path": "app/components/auth/validateEditProfile.js", "max_stars_repo_name": "esogelola/Lofilan", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/components/auth/validateEditProfile.js", "max_issues_repo_name": "esogelola/Lofilan", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/components/auth/validateEditProfile.js", "max_forks_repo_name": "esogelola/Lofilan", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.9259259259, "max_line_length": 78, "alphanum_fraction": 0.642765685}
export default function validateEditProfile(values) {
  let errors = {};
  // Name Errors
  if (!values.name) {
    errors.name = 'A username is required.';
  }

  //Email Errors
  if (!values.email) {
    errors.email = 'A email is required.';
  } else if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(values.email)) {
    errors.email = 'Your email is invalid.';
  }

  if (!values.currentPassword) {
    //Password Errors
    errors.currentPassword = 'A current password is required.';
  } else if (values.currentPassword.length < 6) {
    errors.currentPassword =
      'Your currrent password password must be at least 6 characters';
  }
  if (values.newPassword.length < 6) {
    errors.newPassword = 'Your password must be at least 6 characters';
  }
  return errors;
}
