{"size": 997, "ext": "js", "max_stars_repo_path": "client/src/utils/formValidation.js", "max_stars_repo_name": "thaymerapv/initial-personal-website", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/src/utils/formValidation.js", "max_issues_repo_name": "thaymerapv/initial-personal-website", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/src/utils/formValidation.js", "max_forks_repo_name": "thaymerapv/initial-personal-website", "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": 32.1612903226, "max_line_length": 206, "alphanum_fraction": 0.5837512538}
export function minLengthValidation(inputData, minLength) {
    const {value} = inputData;
    removeClassErrorSuccess(inputData)
    if (value.length >= minLength) {
        inputData.classList.add('success')
        return true;
    } else {
        inputData.classList.add('error')
        return false;
    }
}

export function emailValidation(inputData) {
    const emailValid = new RegExp('/^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/')
    const {value} = inputData;
    removeClassErrorSuccess(inputData)
    const resultValidation = emailValid.test(value)
    if (resultValidation) {
        inputData.classList.add('success')
        return true;
    } else {
        inputData.classList.add('error')
        return false;
    }
}

function removeClassErrorSuccess(inputData) {
    inputData.classList.remove('success')
    inputData.classList.remove('error')
}
