Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
juanborre committed Apr 27, 2018
1 parent a759884 commit 8170128
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions helpers/csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ function formatRegularValue(value) {
}

const type = typeof value;
value = (type === 'object') ? JSON.stringify(value) : (
(type === 'string') ? value : String(value)
);
if (type === 'object') {
value = JSON.stringify(value)
} else if (type !== 'string') {
value = String(value);
}

if (value.match(SPECIAL_CHARACTERS_REGEX)) {
return `"${value.replace(/"/g, '""')}"`;
Expand Down

0 comments on commit 8170128

Please sign in to comment.