I have to parse object like below:
const obj = {
"package": {
"dependencies": {
"a": "b",
"c": "d"
}
}
}
to this format:
const data = {
"package": [
{
"dependencies": [
{ key: "a", value: "b" },
{ key: "c", value: "d" }
]
}
]
}
Can someone tell me how to do this? Thanks for any help!