<commit_before>export default function ({types: t}) {
  const generateElement = (path, file) => {
    if (/JSXText/.test(path.type)) return t.StringLiteral(path.value);

    const OPENING_ELEMENT = path.node ? path.node.openingElement : path.openingElement,
    CHILDREN = path.node ? path.node.children : path.children,
    ELEMENT_ATTRIBUTES = OPENING_ELEMENT.attributes;

    let elementName = t.StringLiteral(OPENING_ELEMENT.name.name),
    attributes = ELEMENT_ATTRIBUTES.length ? buildAttributeObject(ELEMENT_ATTRIBUTES, file) : t.NullLiteral(),
    children = CHILDREN.length ? t.ArrayExpression(CHILDREN.map(child => generateElement(child, file))) : t.NullLiteral();

    return t.ObjectExpression([
      t.ObjectProperty(t.StringLiteral('elementName'), elementName),<commit_msg>If path is not element, it is an expression or a string, so pass it along with out building more<commit_after>export default function ({types: t}) {
  const generateElement = (path, file) => {
    if (!/JSXElement/.test(path.type)) return path.expression ? path.expression : t.StringLiteral(path.value);

    const OPENING_ELEMENT = path.node ? path.node.openingElement : path.openingElement,
    CHILDREN = path.node ? path.node.children : path.children,
    ELEMENT_ATTRIBUTES = OPENING_ELEMENT.attributes;

    let elementName = t.StringLiteral(OPENING_ELEMENT.name.name),
    attributes = ELEMENT_ATTRIBUTES.length ? buildAttributeObject(ELEMENT_ATTRIBUTES, file) : t.NullLiteral(),
    children = CHILDREN.length ? t.ArrayExpression(CHILDREN.map(child => generateElement(child, file))) : t.NullLiteral();

    return t.ObjectExpression([
      t.ObjectProperty(t.StringLiteral('elementName'), elementName),
{'fraction_non_alphanumeric': 0.11948204826368453, 'fraction_numerical': 0.0, 'mean_word_length': 4.944055944055944, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2428056', 'n_tokens_mistral': 514, 'n_tokens_neox': 500, 'n_words': 104}