I am wanting to perform the below transformation, but am having trouble with how to do it, just wondering if anyone has any pointers:
//Source
[
{ types: ['a', 'b'] },
{ types: ['b'] },
{ types: ['a', 'c'] }
]
//Transformation
{
'a': [ { types: ['a', 'b'] }, { types: ['a', 'c'] } ],
'b': [ { types: ['a', 'b'] }, { types: ['b'] } ],
'c': [ { types: ['a', 'c'] } ]
}