I'm working with a nested json object structured like this:
{
"fontweight": {
"primary": {
"weight1": {
"value": "Regular",
"type": "fontWeights"
},
"weight2": {
"value": "SemiBold",
"type": "fontWeights"
}
},
}
}
Imagine I receive a key and value pair, like so:
{
key: "fontweight.primary.weight1.value",
value: "Bold"
}
The task at hand is to update the value for the specified key within my nested json structure. How might one go about accomplishing this?