<commit_before>import {createLineChart} from './src/line';

const chartDiv = document.getElementById('chart');

createLineChart().then((node) => {
  chartDiv.appendChild(node);
})<commit_msg>use HMR<commit_after>import {createLineChart} from './src/line';

if (module.hot) {
  module.hot.accept();
}

function assertExists<T>(value: T|null|undefined): T {
  if(value == null) {
    throw new Error(`Expected to exist: ${value}`);
  }
  return value;
}

const chartDiv = assertExists(document.getElementById('chart') as HTMLDivElement);

function init() {
  createLineChart().then((node) => {
    chartDiv.textContent = '';
    chartDiv.appendChild(node);
  });
}
init();

if (module.hot) {
  module.hot.dispose(function() {
    // module is about to be replaced
  })

  module.hot.accept(function() {
    init();
  })
}
{'fraction_non_alphanumeric': 0.1746031746031746, 'fraction_numerical': 0.0, 'mean_word_length': 4.430463576158941, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '5667045', 'n_tokens_mistral': 266, 'n_tokens_neox': 265, 'n_words': 53}