I am trying to reformat this array of objects:
let users = [{
Username: "test1",
Attributes: [{
Name: "sub",
Value: "1234"
}, {
Name: "email",
Value: "[email protected]"
}]
},
{
Username: "test2",
Attributes: [{
Name: "sub",
Value: "5678"
}, {
Name: "email",
Value: "[email protected]"
}]
},
]
I want to reformat to this:
users: [{
Username: "test1",
sub: "1234",
email: "[email protected]}, {
Username: "test2",
sub: "5678",
email: "[email protected]}]
How to reformat this array of the object? Thanks