csv-generate
Advanced tools
Comparing version 3.0.0 to 3.1.0
# Changelog | ||
## Version 3.1.0 | ||
* duration: fix start time | ||
* package: MIT license (was BSD) | ||
* sleep: new option | ||
## Version 3.0.0 | ||
@@ -5,0 +11,0 @@ |
@@ -129,3 +129,3 @@ "use strict"; | ||
this._ = { | ||
start_time: Date.now(), | ||
start_time: this.options.duration ? Date.now() : null, | ||
fixed_size_buffer: '', | ||
@@ -248,3 +248,4 @@ count_written: 0, | ||
this._.count_written++; | ||
this.push(line); | ||
this.__push(line); | ||
} | ||
@@ -260,3 +261,4 @@ } else { | ||
this._.count_written++; | ||
this.push(data.join('')); | ||
this.__push(data.join('')); | ||
} | ||
@@ -270,2 +272,16 @@ | ||
} | ||
}; // ## `Generator.prototype._read(size)` | ||
// Put new data into the read queue. | ||
_Generator.prototype.__push = function (record) { | ||
var _this = this; | ||
if (this.options.sleep) { | ||
return setTimeout(function () { | ||
return _this.push(record); | ||
}, this.options.sleep); | ||
} else { | ||
return this.push(record); | ||
} | ||
}; // ## `Generator.ascii(gen)` | ||
@@ -276,7 +292,9 @@ // Generate an ASCII value. | ||
_Generator.ascii = function (gen) { | ||
var char, column, j, nb_chars, ref; // Column | ||
var _, char, column, j, nb_chars, ref; // Column | ||
column = []; | ||
nb_chars = Math.ceil(gen.random() * gen.options.maxWordLength); | ||
for (nb_chars = j = 0, ref = Math.ceil(gen.random() * gen.options.maxWordLength); 0 <= ref ? j < ref : j > ref; nb_chars = 0 <= ref ? ++j : --j) { | ||
for (_ = j = 0, ref = nb_chars; 0 <= ref ? j < ref : j > ref; _ = 0 <= ref ? ++j : --j) { | ||
char = Math.floor(gen.random() * 32); | ||
@@ -283,0 +301,0 @@ column.push(String.fromCharCode(char + (char < 16 ? 65 : 97 - 16))); |
@@ -114,3 +114,3 @@ // Generated by CoffeeScript 2.3.2 | ||
this._ = { | ||
start_time: Date.now(), | ||
start_time: this.options.duration ? Date.now() : null, | ||
fixed_size_buffer: '', | ||
@@ -221,3 +221,3 @@ count_written: 0, | ||
this._.count_written++; | ||
this.push(line); | ||
this.__push(line); | ||
} | ||
@@ -232,3 +232,3 @@ } else { | ||
this._.count_written++; | ||
this.push(data.join('')); | ||
this.__push(data.join('')); | ||
} | ||
@@ -242,2 +242,15 @@ break; | ||
// ## `Generator.prototype._read(size)` | ||
// Put new data into the read queue. | ||
Generator.prototype.__push = function(record) { | ||
if (this.options.sleep) { | ||
return setTimeout(() => { | ||
return this.push(record); | ||
}, this.options.sleep); | ||
} else { | ||
return this.push(record); | ||
} | ||
}; | ||
// ## `Generator.ascii(gen)` | ||
@@ -247,6 +260,7 @@ | ||
Generator.ascii = function(gen) { | ||
var char, column, j, nb_chars, ref; | ||
var _, char, column, j, nb_chars, ref; | ||
// Column | ||
column = []; | ||
for (nb_chars = j = 0, ref = Math.ceil(gen.random() * gen.options.maxWordLength); (0 <= ref ? j < ref : j > ref); nb_chars = 0 <= ref ? ++j : --j) { | ||
nb_chars = Math.ceil(gen.random() * gen.options.maxWordLength); | ||
for (_ = j = 0, ref = nb_chars; (0 <= ref ? j < ref : j > ref); _ = 0 <= ref ? ++j : --j) { | ||
char = Math.floor(gen.random() * 32); | ||
@@ -253,0 +267,0 @@ column.push(String.fromCharCode(char + (char < 16 ? 65 : 97 - 16))); |
{ | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25684
670
1