I am facing a challenge in TypeScript where I need to convert poorly formatted data from an API into an array of objects. The data is currently structured as one large object, which poses a problem.
Here is a snippet of the data:
Your data here...
The goal is to transform this data into an array of objects that group corresponding values together like this:
[
{
KeyBoolean00: "deling",
LabelBoolean00: "Ekstern Deling",
ValueBoolean00: false
},
{
KeyDateTime00: "start",
LabelDateTime00: "Startdato",
ValueDateTime00: "2020-01-07T00:00:00Z"
},
{
KeyString00: "status"
LabelString00: "Prosjektstatus"
ValueString00: "Godkjennt"
}
]
I have attempted some solutions but haven't found the right approach yet.