{"size": 954, "ext": "js", "max_stars_repo_path": "src/loaders/addOns.js", "max_stars_repo_name": "dustinlynch/dead-by-daylight", "max_stars_repo_stars_event_min_datetime": "2020-05-21T02:53:19.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-15T20:46:35.000Z", "max_issues_repo_path": "src/loaders/addOns.js", "max_issues_repo_name": "dustinlynch/dead-by-daylight", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/loaders/addOns.js", "max_forks_repo_name": "dustinlynch/dead-by-daylight", "max_forks_repo_forks_event_min_datetime": "2021-07-17T17:17:40.000Z", "max_forks_repo_forks_event_max_datetime": "2021-07-17T17:17:40.000Z"}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 31.8, "max_line_length": 121, "alphanum_fraction": 0.6939203354}
import mapObj from "map-obj"

import titleCase from "lib/titleCase"

import rawEntries from "src/data/addOns?aot"

function normalize(id, addOn) {
  const normalizedAddOn = {
    id,
    shortId: addOn.shortId || id,
    title: addOn.title || titleCase(addOn.shortId || id),
    visible: addOn.visible === undefined ? true : addOn.visible,
    rarity: addOn.rarity || "common",
    for: addOn.for,
    forType: addOn.type,
    iconId: addOn.iconId || addOn.shortId || id,
  }
  const iconFolder = addOn.iconFolder ? `${addOn.iconFolder}/` : ""
  normalizedAddOn.iconPath = addOn.iconPath || `UI/Icons/ItemAddons/${iconFolder}iconAddon_${normalizedAddOn.iconId}.png`
  if (normalizedAddOn.visible) {
    normalizedAddOn.released = addOn.released === undefined ? true : addOn.released
  } else {
    normalizedAddOn.released = false
  }
  return normalizedAddOn
}

export default mapObj(rawEntries, (id, object) => {
  return [id, normalize(id, object)]
})