<commit_before>import { document, Node } from 'global';

function getRenderedTree(story: { render: () => any }) {
  const component = story.render();
  const componentContent = component.getHTML ? component.getHTML() : component;

  const section: HTMLElement = document.createElement('section');
  section.innerHTML = componentContent;

  if (section.childElementCount > 1) {
    return section;
  }

  return section.firstChild;
}<commit_msg>updated to work with lit-html<commit_after>import { document, Node } from 'global';

function getRenderedTree(story: { render: () => any }) {
  const component = story.render();
  return component.getHTML ? component.getHTML() : component;
}
{'fraction_non_alphanumeric': 0.12846715328467154, 'fraction_numerical': 0.00145985401459854, 'mean_word_length': 4.965217391304348, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6818983', 'n_tokens_mistral': 193, 'n_tokens_neox': 188, 'n_words': 50}