<commit_before>import flattenDeep from 'lodash/flattenDeep'
import head from 'lodash/head'
import map from 'lodash/map'
import noop from 'lodash/noop'

export default function traverseMJML(mjml, predicate = noop, ignoreTagContent = null) {
  const traverse = mjml =>
    map(mjml.children, child => {
      if (ignoreTagContent && child.tagName === ignoreTagContent) {
        return []
      }

      if (predicate(child)) {
        return child
      }

      return traverse(child)
    })

  return head(flattenDeep(traverse(mjml)))
}<commit_msg>revert traverseMjml<commit_after>import flattenDeep from 'lodash/flattenDeep'
import head from 'lodash/head'
import map from 'lodash/map'
import noop from 'lodash/noop'

export default function traverseMJML(mjml, predicate = noop) {
  const traverse = mjml =>
    map(mjml.children, child => {
      if (predicate(child)) {
        return child
      }

      return traverse(child)
    })

  return head(flattenDeep(traverse(mjml)))
}
{'fraction_non_alphanumeric': 0.10772357723577236, 'fraction_numerical': 0.0, 'mean_word_length': 3.5391705069124426, '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': '6072774', 'n_tokens_mistral': 339, 'n_tokens_neox': 307, 'n_words': 78}