Convert array in columns of a csv to JSON

My csv file has the below structure
enter image description here

With column col2 and col3 being array of objects and col4 being an array , when I try to convert this csv to JSON using nodeJs , the arrays are converted as string as below .

[
{
"col1": "Text 1",
"col2": "[{'id': 25, 'name': 'Hello', 'count': 1174}, {'id': 26, 'name': Bye', 'count':15}, {'id': 10, 'name': 'Inspiring', 'count': 24924}]",
"col3": "[{'id': 25, 'name': 'Hello', 'count': 1174}, {'id': 26, 'name': Bye', 'count':15}, {'id': 10, 'name': 'Inspiring', 'count': 24924}]",
"col4r": "[ funnny', 'sad', 'temp']"
},
{
"col1": "Text 2",
"col2": "[{'id': 25, 'name': 'Hello', 'count': 1174}, {'id': 26, 'name': Bye', 'count':15}, {'id': 10, 'name': 'Inspiring', 'count': 24924}]",
"col3": "[{'id': 25, 'name': 'Hello', 'count': 1174}, {'id': 26, 'name': Bye', 'count':15}, {'id': 10, 'name': 'Inspiring', 'count': 24924}]",
"col4r": "[ funnny', 'sad', 'temp']"
}
]

Could somebody help me to convert the csv array columns to array in JSON file. This is the code I am using

function csvTojs(csv) {
  var lines=csv.split("n");
  var result = [];
  var headers = lines[0].split(",");

  for(var i=1; i

Any help will be greatly appreciated .Thank you.

All topic