I have an array of objects which I wish to convert into a plain Immutable map of:
name: {
urlname
id
}
Currently I am doing the following data being the array of objects:
data = data.map((data) => ({
name: data.name,
urlName: data.urlName,
id: data.id
}))
What I am trying to transform is the following (data):
[{"id":"10","name":"Dave","urlName":"foo-bar","order":"-100","classId":"12","className":"David","classUrlName":"david-foo-bar"}]
As said above, I would like the name as the key, and both the urlName and the id as values to the key if possible. I would like to loop around data until everything is reduced to that structure if possible.