I have this javascript object format
{
"draw": "",
"columns": [
{
"data": "userid",
"name": "",
"searchable": true,
"search": {
"value": "",
"regex": false
}
}
]
}
and what I need to do is convert it into single dimension object like
{
"draw" : "",
"columns[data]": "userid",
"columns[name]": "",
"columns[searchable]": "true",
"columns[searchable][value]": "",
"columns[searchable][regex]":"true"
}
the primary object can be multiple layers deep and contains objects as well as arrays.
any ideas suggestions much appreciated as JS is not my forte.
columns[0][searchable][regex]:instead ofcolumns[searchable][regex]?