Forum Discussion
alchemiz
3 years agoContributor III
Just replace the criteria when checking for the col object…
$group.map((g,i)=> $row.find((a,b,c)=> a[‘@id’] == i + 1) instanceof Object ? g.mapValues((val,key)=> $row.find((a,b,c)=> a[‘@id’] == i + 1)[‘col’].find((x,y,z)=> x[‘@id’] == (g.keys().indexOf(key) + 1)) instanceof Object ? $row.find((a,b,c)=> a[‘@id’] == i + 1)[‘col’].find((x,y,z)=> x[‘@id’] == (g.keys().indexOf(key) + 1)).get(‘$’,val) : val ) : g )