function splitByMonth(files) {
  let result = [];
  files.forEach(function(file) {
    const month = parseInt(file.datePublishedMonth, 10);
    if (!result[month]) {
      result[month] = {
        title: moment.months()[month - 1],
        articles: [],
      };
    }
    result[month].articles.push(file);
  });
  return result;
}
Splits a list of files by month published

@param {Array} files The array of files to split.
@return {Array} A list of files split by month.