Wrapping each element of the the row in quotes
Commas inside of an element were not supported as the element in the data source wasn't being wrapped in quotes. Wrapping the element in quotes before joining should resolve the problem.
This commit is contained in:
parent
f34895ca85
commit
56ab83adcd
1 changed files with 1 additions and 1 deletions
|
|
@ -19,7 +19,7 @@ export const jsons2arrays = (jsons, headers) => {
|
|||
};
|
||||
|
||||
export const joiner = ((data,separator = ',') =>
|
||||
data.map((row, index) => row.join(separator)).join(`\n`)
|
||||
data.map((row, index) => row.map((element) => "\"" + element + "\"").join(separator)).join(`\n`)
|
||||
);
|
||||
|
||||
export const arrays2csv = ((data, headers, separator) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue