Skip to content

Commit

Permalink
CSV Extract from NeoDash adds quotes and leading white space
Browse files Browse the repository at this point in the history
  • Loading branch information
JonanOribe committed Dec 6, 2024
1 parent 86058df commit b4a1ab8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/chart/ChartUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,14 @@ export const downloadCSV = (rows) => {
headers.forEach((header) => {
// Parse value
let value = row[header];
if (value && 'low' in value) {
if (value?.low !== undefined) {
value = value.low;
}
csv += `${JSON.stringify(value)}`;
if(typeof value === 'string'){
csv += value;
}else{
csv += `${JSON.stringify(value)}`;
}
csv += headers.indexOf(header) < headers.length - 1 ? ',' : '';
});
csv += '\n';
Expand Down

0 comments on commit b4a1ab8

Please sign in to comment.