title: Filter nested array by matching keywords in both parent or child
body: <p>I need to filter a nested array by matching a keyword. It must return all the objects that matches the name attribute of the parent OR one of its children and filter its children too.</p>
  
  <p>Example:</p>
  
  <pre><code>[
    {
      "name": "abc",
      "children": [
        { "name": "abcd" },
        { "name": "efg" }
      ]
    },
    {
      "name": "hjk",
      "children": [
        { "name": "lmn" },
        { "name": "opq" }
      ]
    },
    {
      "name": "xyz",
      "children": [
        { "name": "lmn" },
        { "name": "abcdef" }
      ]
    }
  ]
  </code></pre>
  
  <p>If text input is "ab", then it must return:</p>
  
  <pre><code>[
    {
      "name": "abc",
      "children": [
        { "name": "abcd" }
      ]
    },
    {
      "name": "xyz",
      "children": [
        { "name": "abcdef" }
      ]
    }
  ]
  </code></pre>
  
  <p>(It matches the parent OR at least one of the children, and returns but parent and children)</p>
  
  <p>Right now, I can only filter the parents like this:</p>
  
  <pre><code>filteredArray = _.filter(array, (parent) =&gt; {
      return _.includes(_.toLower(parent.name), _.toLower(filterText));
  });
  </code></pre>
  
  <p>How can I modify this so it filters the children too?</p>
  
  <p><strong>EDIT:</strong>
  A parent can have empty or no children array.</p>