I need assistance with converting form-data where the field names reference a nested JSON structure into a JSON object. The initial object representing the form-data is as follows:
{
"custom[1].a": "FIXED",
"custom[1].b": "",
"custom[1].c": "PROPORTIONATE",
"custom[1].d": ""
"custom[2].a": "FIXED2",
"custom[2].b": "",
"custom[2].c": "PROPORTIONATE2",
"custom[2].d": ""
}
My goal is to convert this into an object that can be easily stringified:
"customConfiguration": [
{
"a": "PROPORTIONATE",
"b": "",
"c": "FIXED",
"d": ""
},
{ "a": "PROPORTIONATE2",
"b": "",
"c": "FIXED2",
"d": ""
}]