This is my function which should save the string to file.
function downloadCsvFile(csv, filename) { const blob = new Blob([csv], { type: \'text/csv\' });