From 56ab83adcd7ed038f850cf20521d2ec13001fa4b Mon Sep 17 00:00:00 2001 From: quintezkiller Date: Thu, 9 Mar 2017 07:42:35 -0500 Subject: [PATCH] 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. --- src/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.js b/src/core.js index 47f80eb..3f9e42f 100644 --- a/src/core.js +++ b/src/core.js @@ -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) =>