function transformByMonth(data = {}) {
  const years = Object.keys(data);
  if (!years.length) {
    return {};
  }

  return years.reduce((acc, year) => {
    acc[year] = data[year].map((value, monthIdx) => ({
      month: getMonthName(monthIdx + 1, 3),
      value,
    }));
    return acc;
  }, {});
}
/**
 * Transform v2 byMonth object to map of month:value pairs
 *
 * @param {Object} data
 * @param {Array} Array of month:value pairs
 */
Transform v2 byMonth object to map of month:value pairs
@param {Object} data
@param {Array} Array of month:value pairs
Transform v2 byMonth object to map of month : value pairs @param { Object } data @param { Array } Array of month : value pairs
function transformByMonth(data = {}) {
  const years = Object.keys(data);
  if (!years.length) {
    return {};
  }
  return years.reduce((acc, year) => {
    acc[year] = data[year].map((value, monthIdx) => ({
      month: getMonthName(monthIdx + 1, 3),
      value,
    }));
    return acc;
  }, {});
}
function transformByMonth ( data = { } ) { const years = Object . keys ( data ) ; if ( ! years . length ) { return { } ; } return years . reduce ( ( acc , year ) => { acc [ year ] = data [ year ] . map ( ( value , monthIdx ) => ( { month : getMonthName ( monthIdx + 1 , 3 ) , value , } ) ) ; return acc ; } , { } ) ; }
Transform v2 byMonth object to map of month:value pairs
 @param {Object} data
 @param {Array} Array of month:value pairs
Transform v2 byMonth object to map of month : value pairs @param { Object } data @param { Array } Array of month : value pairs