Skip to content

Commit 2d60445

Browse files
committed
Fixing json-2-csv to fix #4
1 parent fac7f7e commit 2d60445

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/json-2-csv.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ var convertData = function (data, keys) {
5151
} else if (typeof value === 'object' && value !== null && typeof value.length === 'number') { // We have an array of values
5252
output.push((options.DELIMITER.WRAP || '') + '[' + value.join(options.DELIMITER.ARRAY) + ']' + (options.DELIMITER.WRAP || ''));
5353
} else {
54-
output.push((options.DELIMITER.WRAP || '') + (value || '') + (options.DELIMITER.WRAP || '')); // Otherwise push the current value
54+
value = value == null ? '' : value;
55+
output.push((options.DELIMITER.WRAP || '') + value + (options.DELIMITER.WRAP || '')); // Otherwise push the current value
5556
}
5657
}
5758
});

0 commit comments

Comments
 (0)