<commit_before>const countDays = (startDate, endDate) => {
  console.log({startDate, endDate});
  const yearInDays = []
  let currentDate = startDate
  console.log({currentDate, 'typeof': typeof currentDate});
  // let currentDate = new Date()
  while (currentDate <= endDate) {
    yearInDays.push(currentDate)
    currentDate = currentDate.setDate(currentDate.getDate() + 1)
  }

  return yearInDays.reduce((counter, day) => {
      counter[day] ? counter[day]++ : counter[day] = 1
      return counter
    }, {})
}

const now = new Date()
const thisYear = now.getFullYear()
const [startDate, endDate] = [new Date(`01/01/${thisYear}`), new Date(`12/31/${thisYear}`)]

export default countDays(startDate, endDate) // returns an object with keys corresponding to each day of the week, and respective values which count how many of those occur during the specified date range, in our case thisYear.<commit_msg>make CountDays provide correct array<commit_after>const countDays = (startDate, endDate) => {
  const yearInDays = []
  let currentDate = startDate
  // let currentDate = new Date()
  while (currentDate <= endDate) {
    currentDate = new Date(currentDate)
    yearInDays.push(currentDate.getDay())
    currentDate = currentDate.setDate(currentDate.getDate() + 1)
  }

  return yearInDays.reduce((counter, day) => {
      counter[day] ? counter[day]++ : counter[day] = 1
      return counter
    }, {})
}

const now = new Date()
const thisYear = now.getFullYear()
const [startDate, endDate] = [new Date(`01/01/${thisYear}`), new Date(`12/31/${thisYear}`)]

export default countDays(startDate, endDate) // returns an object with keys corresponding to each day of the week, and respective values which count how many of those occur during the specified date range, in our case thisYear.
{'fraction_non_alphanumeric': 0.12548800892359174, 'fraction_numerical': 0.011154489682097044, 'mean_word_length': 4.339285714285714, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '91006', 'n_tokens_mistral': 546, 'n_tokens_neox': 530, 'n_words': 168}