how to convert the json array name with its immediate fieldname using typescript

Viewed 25

Assume, I have a Json as below:

"singleField" : [
{
"fieldName": "company",
"fieldValue": "xyz"
}
]

I have to convert this into:

"company": [
{
fieldValue": "xyz"
}
]

Kindly guide me to do this using typescript code.

0 Answers
Related