Lodash OrderBy with child attributes
<p>I have a requirement where i should sort by object attributes and child attributes , is there a better way to handle this .</p>

<pre><code>const testData=[{id:1,name:"test",notes:"test notes",child:[{name:"weight",value:3},{name:"category",value:"testCategory"},{name:"amount",value:2}]},{id:2,name:"test2",notes:"test notes2",child:[{name:"weight",value:4},{name:"category",value:"testCategory"},{name:"amount",value:3}]}]
</code></pre>

<p>I need to sort by name(asc) and category (desc)</p>

<p>I know it individually like below </p>

<pre><code>_.orderBy(testData,['notes'],[asc])
_.orderBy(testData,(t)=&gt;{
              return  _.filter(t.child, (c)=&gt; {
                             return c.name == "category"
                         })[0]['value']

          }
</code></pre>

<p>How to combine both of them in single orderBY</p>