Comparing version 0.3.2 to 0.3.3
@@ -8,2 +8,4 @@ module.exports=csvAdv; | ||
var Result=require("./Result"); | ||
var os=require("os"); | ||
var eol=os.EOL; | ||
function csvAdv(params){ | ||
@@ -65,3 +67,3 @@ Transform.call(this); | ||
self._headRowProcess(row); | ||
self.push("[\n"); | ||
self.push("["+eol); | ||
}else if(rowStr.length>0){ | ||
@@ -72,3 +74,3 @@ var resultRow={}; | ||
if (started===true ){ | ||
self.push(",\n"); | ||
self.push(","+eol); | ||
} | ||
@@ -94,4 +96,4 @@ self.push(JSON.stringify(resultRow)); | ||
this._buffer+=data.toString(encoding); | ||
if (this._buffer.indexOf("\n")>-1){ | ||
var arr=this._buffer.split("\n"); | ||
if (this._buffer.indexOf(eol)>-1){ | ||
var arr=this._buffer.split(eol); | ||
while(arr.length>1){ | ||
@@ -111,3 +113,3 @@ var data=arr.shift(); | ||
} | ||
this.push("\n]"); | ||
this.push(eol+"]"); | ||
cb(); | ||
@@ -114,0 +116,0 @@ }; |
@@ -17,3 +17,3 @@ { | ||
], | ||
"version":"0.3.2", | ||
"version":"0.3.3", | ||
"keywords":[ | ||
@@ -20,0 +20,0 @@ "csv", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
33592
522