csv-generate
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -102,3 +102,4 @@ // Generated by CoffeeScript 1.7.1 | ||
} | ||
this.count = 0; | ||
this.count_written = 0; | ||
this.count_created = 0; | ||
if (typeof this.options.headers === 'number') { | ||
@@ -149,3 +150,3 @@ this.options.headers = new Array(this.options.headers); | ||
while (true) { | ||
if ((this.count + data.length === this.options.length) || (this.options.end && Date.now() > this.options.end)) { | ||
if ((this.count_created === this.options.length) || (this.options.end && Date.now() > this.options.end)) { | ||
if (data.length) { | ||
@@ -155,7 +156,7 @@ if (this.options.objectMode) { | ||
line = data[_i]; | ||
this.count++; | ||
this.count_written++; | ||
this.push(line); | ||
} | ||
} else { | ||
this.count++; | ||
this.count_written++; | ||
this.push(data.join('')); | ||
@@ -179,5 +180,6 @@ } | ||
} else { | ||
line = "" + (this.count + data.length === 0 ? '' : '\n') + (line.join(this.options.delimiter)); | ||
line = "" + (this.count_created === 0 ? '' : '\n') + (line.join(this.options.delimiter)); | ||
lineLength = line.length; | ||
} | ||
this.count_created++; | ||
if (length + lineLength > size) { | ||
@@ -188,3 +190,3 @@ if (this.options.objectMode) { | ||
line = data[_l]; | ||
this.count++; | ||
this.count_written++; | ||
this.push(line); | ||
@@ -199,3 +201,3 @@ } | ||
} | ||
this.count++; | ||
this.count_written++; | ||
this.push(data.join('')); | ||
@@ -202,0 +204,0 @@ } |
{ | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"name": "csv-generate", | ||
@@ -4,0 +4,0 @@ "description": "CSV and object generation implementing the Node.js `stream.Readable` API", |
Sorry, the diff of this file is not supported yet
25157
260