{"size": 475, "ext": "js", "max_stars_repo_path": "src/utils/validate.js", "max_stars_repo_name": "wudongyu1994/yunplm-front-end", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/utils/validate.js", "max_issues_repo_name": "wudongyu1994/yunplm-front-end", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/utils/validate.js", "max_forks_repo_name": "wudongyu1994/yunplm-front-end", "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": 19.7916666667, "max_line_length": 83, "alphanum_fraction": 0.5473684211}
/**
 * Created by PanJiaChen on 16/11/18.
 */

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}

export function isPhone(test) {
  return /^(((13[0-9])|(14[0-9])|(15[0-9])|(18[0-9]))\s*\d{4}\s*\d{4})$/.test(test)
}

export function isNo(test) {
  return /^[A-Za-z0-9]+$/.test(test)
}

export function isEmail(test) {
  return /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(test)
}
