{"size": 544, "ext": "js", "max_stars_repo_path": "src/carbon-dating.js", "max_stars_repo_name": "Vitaliy-Mazurenko/basic-js", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/carbon-dating.js", "max_issues_repo_name": "Vitaliy-Mazurenko/basic-js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/carbon-dating.js", "max_forks_repo_name": "Vitaliy-Mazurenko/basic-js", "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": 23.652173913, "max_line_length": 70, "alphanum_fraction": 0.7003676471}
const CustomError = require("../extensions/custom-error");

const MODERN_ACTIVITY = 15;
const HALF_LIFE_PERIOD = 5730;

module.exports = function dateSample(sampleActivity) {
  if (typeof sampleActivity !== 'string') {
    return false
  }
  if (sampleActivity.trim() === '') {
    return false
  }

  const sampleActivityNum = Number(sampleActivity);
  if (isNaN(sampleActivityNum)) {
    return false
  }
  if (sampleActivityNum > MODERN_ACTIVITY || sampleActivityNum <= 0) {
    return false
  }
  return MODERN_ACTIVITY / sampleActivity
};
