I'm trying to convert a JSON object into a different format using JavaScript and lodash:
{
"BidNumber": 2,
"BidResult": 1,
"BidAmount": "6756",
"BidData": [
{
"name": "JonSnow",
"Data": "Standard data for Jon Snow"
},
{
"LineNum": "HarryPotter",
"Data": "Standard data for Jon Snow"
},
{
"LineNum": "MickyMouse",
"Data": "Standard data for Micky Mouse"
}
],
"BidReference": "22e06e66-e711-bd14-7874a-002219649f24"
}
My goal is to transform it into this structure:
{
"bidNumber": 2,
"bidResult": 1,
"bidAmount": "6756",
"bidData": {
"jonSnow": "Standard data for Jon Snow",
"harryPotter": "Standard data for Jon Snow",
"mickyMouse": "Standard data for Micky Mouse"
},
"bidReference": "22e06e66-e711-bd14-7874a-002219649f24"
}
I'm having trouble finding the right lodash method to achieve this, especially with the camelCase conversion.