I'm expecting (perhaps incorrectly) that double quotes surround every value, but i'm guessing it is only doing so in some cases. My code is as follows:
const {json2csv} = await import('json-2-csv');
const csv = json2csv(result.response.value, {
delimiter: {
wrap: '"',
field: ';',
eol: '\n',
},
emptyFieldValue: '',
});
The CSV is generated, and contains some Arabic, however there are no quotes surrounding the values. Am i doing something wrong, or isn't it possible to force quotes?
I have the following workaround, but was wondering if the plug-in could do it natively.
const quotedCSV = csv
.split('\n')
.map(line =>
line
.split(';')
.map(field => `"${field}"`)
.join(';'),
)
.join('\n');
I'm expecting (perhaps incorrectly) that double quotes surround every value, but i'm guessing it is only doing so in some cases. My code is as follows:
The CSV is generated, and contains some Arabic, however there are no quotes surrounding the values. Am i doing something wrong, or isn't it possible to force quotes?
I have the following workaround, but was wondering if the plug-in could do it natively.