What is the most efficient method for converting a large JSON array of objects into an object with a key named "data" using TypeScript:
Original Format:
[
{
"label":"testing",
"id":1,
"children":[
{
"label":"Preamble",
"id":2
}
]
}
]
Desired Format:
{
"data":[
{
"label":"testing",
"id":1,
"children":[
{
"label":"Preamble",
"id":2
}
]
}
]
}
The only change needed is to wrap the existing data in { "data": ... }