Comparing version 0.0.2-2 to 0.0.2-3
@@ -15,3 +15,3 @@ (function() { | ||
JsonCsv.prototype.parse = function(data, columns, cb) { | ||
var column, csv, i, index, j, json, line, _i, _j, _len, _len2; | ||
var column, csv, field, i, index, j, json, line, _i, _j, _len, _len2; | ||
if (data == null) return cb('error no data'); | ||
@@ -35,8 +35,5 @@ if (columns == null) return cb('error please provide columns as options'); | ||
column = columns[_j]; | ||
if (json[i][index]["" + column] !== void 0) { | ||
line += json[i][index]["" + column] + ","; | ||
} | ||
if (json[i][index]["" + column] === '' || json[i][index]["" + column] === null) { | ||
line += ","; | ||
} | ||
field = json[i][index]["" + column]; | ||
if (field !== void 0) line += field + ","; | ||
if (field === null || field === void 0) line += ","; | ||
} | ||
@@ -43,0 +40,0 @@ } else { |
{ | ||
"name": "jsoncsv", | ||
"description": "A JSON to csv converter for nodeJS", | ||
"version": "0.0.2-2", | ||
"version": "0.0.2-3", | ||
"homepage": "", | ||
@@ -6,0 +6,0 @@ "author": "Kris Windham <krsiwindham@gmail.com>", |
Sorry, the diff of this file is not supported yet
13890
112