Fix for #4119 - any object based column will be exported with the comma types correctly encapsulated.
This commit is contained in:
parent
36bd285093
commit
55b380c3c5
|
@ -5,8 +5,11 @@ exports.csv = function (headers, rows) {
|
|||
csv = `${csv}\n${headers
|
||||
.map(header => {
|
||||
let val = row[header]
|
||||
val = typeof val === "object" ? JSON.stringify(val) : val
|
||||
return `"${val}"`.trim()
|
||||
val =
|
||||
typeof val === "object"
|
||||
? `"${JSON.stringify(val).replace(/"/g, "'")}"`
|
||||
: `"${val}"`
|
||||
return val.trim()
|
||||
})
|
||||
.join(",")}`
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue