{"size": 574, "ext": "js", "max_stars_repo_path": "etsin_finder/frontend/js/utils/buildColumns.js", "max_stars_repo_name": "CSCfi/fairdata-etsin-qvain", "max_stars_repo_stars_event_min_datetime": "2019-11-13T11:52:47.000Z", "max_stars_repo_stars_event_max_datetime": "2019-11-13T11:52:47.000Z", "max_issues_repo_path": "etsin_finder/frontend/js/utils/buildColumns.js", "max_issues_repo_name": "CSCfi/etsin-finder", "max_issues_repo_issues_event_min_datetime": "2017-10-25T14:41:07.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-20T10:39:57.000Z", "max_forks_repo_path": "etsin_finder/frontend/js/utils/buildColumns.js", "max_forks_repo_name": "CSCfi/fairdata-etsin-qvain", "max_forks_repo_forks_event_min_datetime": "2019-03-20T06:55:25.000Z", "max_forks_repo_forks_event_max_datetime": "2020-02-03T11:26:19.000Z"}
{"max_stars_count": 1, "max_issues_count": 106, "max_forks_count": 6, "avg_line_length": 23.9166666667, "max_line_length": 62, "alphanum_fraction": 0.6045296167}
// create named grid-template-columns from [name, value] pairs
const buildColumns = columns => {
  if (columns.length === 0) {
    return ''
  }
  const parts = []
  let startName = columns[0][0]
  let endName = ''
  for (const [name, value] of columns) {
    startName = name
    if (endName) {
      parts.push(`[${endName}-end ${startName}-start]`)
    } else {
      parts.push(`[${startName}-start]`)
    }
    parts.push(value)
    endName = startName
  }
  parts.push(`[${columns[columns.length - 1][0]}-end]`)
  return parts.join(' ')
}

export default buildColumns
