{"size": 448, "ext": "js", "max_stars_repo_path": "lib/util.js", "max_stars_repo_name": "antoniobusrod/adeunis-payload", "max_stars_repo_stars_event_min_datetime": "2019-04-12T07:05:51.000Z", "max_stars_repo_stars_event_max_datetime": "2019-04-12T07:05:51.000Z", "max_issues_repo_path": "lib/util.js", "max_issues_repo_name": "antoniobusrod/adeunis-payload", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/util.js", "max_forks_repo_name": "antoniobusrod/adeunis-payload", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.3636363636, "max_line_length": 67, "alphanum_fraction": 0.5625}
exports.isDefined = (value) => {
  return value !== undefined && value !== null
}

exports.encodeByte = value => {
  return value > 255 ? Buffer.from([0xFF]) : Buffer.from([ value ])
}

exports.encodeSignedByte = value => {
  if (value > 127) {
    value = 127
  } else if (value < -128) {
    value = -128
  }

  if (value >= 0) {
    return Buffer.from([ value & 0x7F ])
  } else {
    return Buffer.from([ ((value + 128) & 0x7F) | 0x80 ])
  }
}
