{"size": 450, "ext": "js", "max_stars_repo_path": "app/controllers/payouts/user-services-names.controller.js", "max_stars_repo_name": "stevenjmesser/pay-selfservice", "max_stars_repo_stars_event_min_datetime": "2017-08-23T03:09:00.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-16T23:03:58.000Z", "max_issues_repo_path": "app/controllers/payouts/user-services-names.controller.js", "max_issues_repo_name": "stevenjmesser/pay-selfservice", "max_issues_repo_issues_event_min_datetime": "2017-08-11T11:03:14.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-29T09:08:40.000Z", "max_forks_repo_path": "app/controllers/payouts/user-services-names.controller.js", "max_forks_repo_name": "stevenjmesser/pay-selfservice", "max_forks_repo_forks_event_min_datetime": "2017-08-22T18:47:29.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-12T20:17:49.000Z"}
{"max_stars_count": 20, "max_issues_count": 579, "max_forks_count": 16, "avg_line_length": 32.1428571429, "max_line_length": 97, "alphanum_fraction": 0.7488888889}
const indexServiceNamesByGatewayAccountId = function indexServiceNamesByGatewayAccountId (user) {
  const services = (user && user.serviceRoles) || []
  return services.reduce((aggregate, serviceRole) => {
    serviceRole.service.gatewayAccountIds.forEach((gatewayAccountId) => {
      aggregate[gatewayAccountId] = serviceRole.service.serviceName.en
    })
    return aggregate
  }, {})
}

module.exports = {
  indexServiceNamesByGatewayAccountId
}
