Converts a comma-separated values (CSV) string to a 2D array of objects. The first row of the string is used as the title row.
const CSVToJSON = (data, delimiter = ',') => {
const titles = data.slice(0, data.indexOf('\n')).split(delimiter);
return data
.slice(data.indexOf('\n') + 1)
.split('\n')
.map(v => {