{"size": 906, "ext": "js", "max_stars_repo_path": "validate/validators/static.js", "max_stars_repo_name": "mikemaccana/utils", "max_stars_repo_stars_event_min_datetime": "2019-03-18T19:50:56.000Z", "max_stars_repo_stars_event_max_datetime": "2019-03-18T19:50:56.000Z", "max_issues_repo_path": "validate/validators/static.js", "max_issues_repo_name": "mikemaccana/utils", "max_issues_repo_issues_event_min_datetime": "2019-08-19T00:08:03.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-03T06:05:01.000Z", "max_forks_repo_path": "validate/validators/static.js", "max_forks_repo_name": "mikemaccana/utils", "max_forks_repo_forks_event_min_datetime": "2019-06-11T12:37:12.000Z", "max_forks_repo_forks_event_max_datetime": "2019-08-29T15:19:26.000Z"}
{"max_stars_count": 1, "max_issues_count": 337, "max_forks_count": 2, "avg_line_length": 37.75, "max_line_length": 110, "alphanum_fraction": 0.6479028698}
/**
 * static
 * ---
 * validator for @static
 *
 * - asserts arc.static is an array of two tuples (say that three times fast)
 * - asserts the first element of the first tuple is 'staging'
 * - asserts the first element of the second tuple is 'production'
 */
module.exports = function static(arc/*, raw*/) {
  var errors = []
  if (arc.static) {
    // expect arc.static = [['staging', 'some-bukkit'], ['production', 'some-other-bukkit']]
    var validTypes = Array.isArray(arc.static) && Array.isArray(arc.static[0]) && Array.isArray(arc.static[1])
    var validStaging = validTypes && arc.static[0][0] === 'staging' && arc.static[0].length === 2
    var validProduction = validTypes && arc.static[1][0] === 'production' && arc.static[1].length === 2
    var validLocally = validStaging && validProduction
    if (!validLocally) {
      errors.push(Error('@static invalid'))
    }
  }
  return errors
}
