{"size": 321, "ext": "js", "max_stars_repo_path": "src/util/streak/getLatest.js", "max_stars_repo_name": "kjhnns/junto-webapp", "max_stars_repo_stars_event_min_datetime": "2020-04-12T19:06:54.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-11T14:17:21.000Z", "max_issues_repo_path": "src/util/streak/getLatest.js", "max_issues_repo_name": "kjhnns/junto-webapp", "max_issues_repo_issues_event_min_datetime": "2020-04-15T15:09:46.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T21:26:27.000Z", "max_forks_repo_path": "src/util/streak/getLatest.js", "max_forks_repo_name": "kjhnns/junto-webapp", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 24.6923076923, "max_line_length": 63, "alphanum_fraction": 0.6853582555}
import count from './count'

const getLatest = (checks, max, stopDate) => {
  const sStopDate = stopDate || checks[checks.length - 1]
  if (checks.length > 0) {
    const currCount = count(sStopDate, checks[0], checks, 0, 0)
    return getLatest(checks, currCount, sStopDate)
  }
  return max
}

export default getLatest
