Skip to content

Commit 3618883

Browse files
committed
making a ternary more readable
1 parent 0b87509 commit 3618883

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/csv-2-json.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ var createDocument = function (keys, line) {
6969

7070
// Reduce the keys into a JSON document representing the given line
7171
return _.reduce(keys, function (document, key) {
72-
// If there is no value (empty string) at the key's index in the line, set the value to null; otherwise the value
73-
val = !line[key.index] ? null : line[key.index];
72+
// If there is a value at the key's index in the line, set the value; otherwise null
73+
val = line[key.index] ? line[key.index] : null;
7474

7575
// If the value is an array representation, convert it
7676
if (isArrayRepresentation(val)) {

0 commit comments

Comments
 (0)