src/index.js
function parseCalendar($calendar) {
  const data = [];
  $calendar.find('rect').each((i, elm) => {
    const $rect = cheerio(elm);
    const date = $rect.attr('data-date');
    if (!date) {
      return;
    }
    data.push({
      date,
      count: parseInt($rect.attr('data-count'), 10)
    });
  });
  return data;
}
function parseCalendar($calendar) {
  const data = [];
  $calendar.find('rect').each((i, elm) => {
    const $rect = cheerio(elm);
    const date = $rect.attr('data-date');
    if (!date) {
      return;
    }
    data.push({
      date,
      count: parseInt($rect.attr('data-count'), 10)
    });
  });
  return data;
}
function parseCalendar ( $calendar ) { const data = [ ] ; $calendar . find ( 'rect' ) . each ( ( i , elm ) => { const $rect = cheerio ( elm ) ; const date = $rect . attr ( 'data-date' ) ; if ( ! date ) { return ; } data . push ( { date , count : parseInt ( $rect . attr ( 'data-count' ) , 10 ) } ) ; } ) ; return data ; }
Parse HTML to list of contribution

@param {Object} $calendar - cheerio object
@return {Array<{date: string, count: number}>}
Parse HTML to list of contribution