<commit_before>// grab our dom elements
let displayBox = document.querySelector('.current-exercise'),
    catalogBox = document.querySelector('.catalog-box'),
    resetButton = document.querySelector('.reset');

// set default exercises if none exist in localStorage
if (!window.localStorage.getItem('exercises')) {
  setDefaultCatalog();
}

// click the 💪 to reset to defaults
resetButton.addEventListener('click', resetRefresh);

function resetRefresh() {
  setDefaultCatalog();
  displayExercise();
  displayCatalog();
}
// set a variable for the localStorage 'exercises' item
let localCatalog = JSON.parse(localStorage.getItem('exercises'));

// define default set of exercises
function setDefaultCatalog() {
  let catalog = {
    ex01: { name: 'Push Ups', reps: 10 },
    ex02: { name: 'Sit Ups', reps: 30 },
    ex03: { name: 'Lunges', reps: 30 },
    ex04: { name: 'Squats', reps: 15 },
    ex05: { name: 'Jumping Jacks', reps: 20 }
  }
  // write exercises to localStorage
  localStorage.setItem('exercises', JSON.stringify(catalog));

  // update to latest data
  localCatalog = JSON.parse(localStorage.getItem('exercises'));
}

// save changes to localStorage upon each 'input' event
catalogBox.addEventListener('input', function (event) {
  // make a copy of the existing localStorage data
  let newCatalog = localCatalog;
<commit_msg>set localStorage to empty object on initialization<commit_after>// grab our dom elements
let displayBox = document.querySelector('.current-exercise'),
    catalogBox = document.querySelector('.catalog-box'),
    resetButton = document.querySelector('.reset');

// set default exercises if none exist in localStorage
if (!window.localStorage.getItem('exercises')) {
  setDefaultCatalog();
}

// click the 💪 to reset to defaults
resetButton.addEventListener('click', resetRefresh);

function resetRefresh() {
  setDefaultCatalog();
  displayExercise();
  displayCatalog();
}
// set a variable for the localStorage 'exercises' item
let localCatalog = JSON.parse(localStorage.getItem('exercises')) || {};

// define default set of exercises
function setDefaultCatalog() {
  let catalog = {
    ex01: { name: 'Push Ups', reps: 10 },
    ex02: { name: 'Sit Ups', reps: 30 },
    ex03: { name: 'Lunges', reps: 30 },
    ex04: { name: 'Squats', reps: 15 },
    ex05: { name: 'Jumping Jacks', reps: 20 }
  }
  // write exercises to localStorage
  localStorage.setItem('exercises', JSON.stringify(catalog));

  // update to latest data
  localCatalog = JSON.parse(localStorage.getItem('exercises'));
}

// save changes to localStorage upon each 'input' event
catalogBox.addEventListener('input', function (event) {
  // make a copy of the existing localStorage data
  let newCatalog = localCatalog;

{'fraction_non_alphanumeric': 0.13089579524680073, 'fraction_numerical': 0.014625228519195612, 'mean_word_length': 4.439363817097416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '310643', 'n_tokens_mistral': 814, 'n_tokens_neox': 793, 'n_words': 244}