{"size": 480, "ext": "js", "max_stars_repo_path": "packages/predicates/src/isEmail.js", "max_stars_repo_name": "MaceM8/validarium", "max_stars_repo_stars_event_min_datetime": "2018-11-23T12:05:44.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-17T09:57:20.000Z", "max_issues_repo_path": "packages/predicates/src/isEmail.js", "max_issues_repo_name": "MaceM8/validarium", "max_issues_repo_issues_event_min_datetime": "2018-11-27T08:47:24.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-08T06:49:21.000Z", "max_forks_repo_path": "packages/predicates/src/isEmail.js", "max_forks_repo_name": "MaceM8/validarium", "max_forks_repo_forks_event_min_datetime": "2018-11-26T09:11:46.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-20T07:33:09.000Z"}
{"max_stars_count": 30, "max_issues_count": 38, "max_forks_count": 8, "avg_line_length": 40.0, "max_line_length": 173, "alphanum_fraction": 0.575}
import { test, both, either } from 'ramda';
import { isNilOrEmptyString } from 'ramda-extension';
import hasLengthMax from './hasLengthMax';

// eslint-disable-next-line max-len
const emailRegExp = /^(([^<>()\[\]\\.,;:\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,}))$/;

/**
@alias module:predicates.isEmail
*/
export default either(isNilOrEmptyString, both(test(emailRegExp), hasLengthMax(200)));
