{"size": 734, "ext": "js", "max_stars_repo_path": "src/_normal.js", "max_stars_repo_name": "ryanblock/depstatus", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/_normal.js", "max_issues_repo_name": "ryanblock/depstatus", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/_normal.js", "max_forks_repo_name": "ryanblock/depstatus", "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": 22.2424242424, "max_line_length": 78, "alphanum_fraction": 0.6089918256}
let semver = require('semver')

module.exports = function normalVersion (params) {
  let { dep, validRange, versionSpecified, versionInstalled, result } = params
  let isOk = semver.satisfies(versionInstalled, validRange)
  let isOutdated = semver.ltr(versionInstalled, validRange)
  if (isOk) {
    result.ok.push({
      [dep]: {
        versionSpecified,
        versionInstalled
      }
    })
  }
  else if (isOutdated) {
    result.outdated.push({
      [dep]: {
        versionSpecified,
        versionInstalled
      }
    })
  }
  else {
    result.warn.push({
      [dep]: {
        versionSpecified,
        versionInstalled,
        warning: 'Installed version is too far ahead of specified version'
      }
    })
  }
}
