function transformLocationsForRender(locations = {}) {
  return Object.keys(locations).reduce((acc, locName) => {
    if (!_isEmpty(locations[locName])) {
      const location = locations[locName];
      acc[locName] = {
        ...location,
        byYear: transformByYear(location.byYear),
        byMonth: transformByMonth(location.byMonth),
      };
    }
    return acc;
  }, {});
}
/**
 * Transform locations object for frontend display in charts
 *
 * @param {Object} location
 * @returns {Object}
 */
Transform locations object for frontend display in charts
@param {Object} location
@returns {Object}
Transform locations object for frontend display in charts @param { Object } location @returns { Object }
function transformLocationsForRender(locations = {}) {
  return Object.keys(locations).reduce((acc, locName) => {
    if (!_isEmpty(locations[locName])) {
      const location = locations[locName];
      acc[locName] = {
        ...location,
        byYear: transformByYear(location.byYear),
        byMonth: transformByMonth(location.byMonth),
      };
    }
    return acc;
  }, {});
}
function transformLocationsForRender ( locations = { } ) { return Object . keys ( locations ) . reduce ( ( acc , locName ) => { if ( ! _isEmpty ( locations [ locName ] ) ) { const location = locations [ locName ] ; acc [ locName ] = { ... location , byYear : transformByYear ( location . byYear ) , byMonth : transformByMonth ( location . byMonth ) , } ; } return acc ; } , { } ) ; }
Transform locations object for frontend display in charts
 @param {Object} location
 @returns {Object}
Transform locations object for frontend display in charts @param { Object } location @returns { Object }