mixpanel api data parsing
const regex = /}}/ig
const commaEndOfObjects = response.data.replace(regex, '}},');
const lastCommaToRemove = commaEndOfObjects.lastIndexOf('}},') + 2
const removeLastComma = commaEndOfObjects.slice(0, lastCommaToRemove) + commaEndOfObjects.slice(lastCommaToRemove +1);
const onlySingleQuotes = removeLastComma.replace(/'/g, '"');
const insideArray = `[${onlySingleQuotes}]`
const result = JSON.parse(insideArray)