1
0
Fork 0
mirror of synced 2024-06-28 11:00:55 +12:00

Don't wrap dates in single quotes

This commit is contained in:
Mel O'Hagan 2022-05-09 15:21:51 +01:00
parent 498fc201de
commit 6e34649ca7

View file

@ -6,7 +6,7 @@ exports.csv = function (headers, rows) {
.map(header => { .map(header => {
let val = row[header] let val = row[header]
val = val =
typeof val === "object" typeof val === "object" && !(val instanceof Date)
? `"${JSON.stringify(val).replace(/"/g, "'")}"` ? `"${JSON.stringify(val).replace(/"/g, "'")}"`
: `"${val}"` : `"${val}"`
return val.trim() return val.trim()