import combinedMetadata from './combinedMetadata';
const combinedMetadataCollection = function combinedMetadataCollection(data) {
  const meta = data.map(combined => combinedMetadata(combined));
  const combined = {
    contests: {},
    candidates: {},
    original: meta
  };
  meta.forEach(m => {
    combined.contests[m.contest.id] = m.contest;
    Object.assign(combined.candidates, m.candidates);
  });
  return combined;
};
export default combinedMetadataCollection;