Skip to content

Commit b4a1ab8

Browse files
committed
CSV Extract from NeoDash adds quotes and leading white space
neo4j-labs#363
1 parent 86058df commit b4a1ab8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/chart/ChartUtils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,14 @@ export const downloadCSV = (rows) => {
164164
headers.forEach((header) => {
165165
// Parse value
166166
let value = row[header];
167-
if (value && 'low' in value) {
167+
if (value?.low !== undefined) {
168168
value = value.low;
169169
}
170-
csv += `${JSON.stringify(value)}`;
170+
if(typeof value === 'string'){
171+
csv += value;
172+
}else{
173+
csv += `${JSON.stringify(value)}`;
174+
}
171175
csv += headers.indexOf(header) < headers.length - 1 ? ',' : '';
172176
});
173177
csv += '\n';

0 commit comments

Comments
 (0)