csv-generate
Advanced tools
Comparing version 3.1.0 to 3.2.0
# Changelog | ||
## Roadmap | ||
* seed: always a number, value "0" disable the feature | ||
* Promise module API | ||
* record_delimiter: rename from row_delimiter | ||
* internal: store options in underscore form | ||
## Version 3.2.0 | ||
* ts: new TypeScript definition files | ||
## Version 3.1.0 | ||
@@ -5,0 +16,0 @@ |
@@ -72,3 +72,14 @@ "use strict"; | ||
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var accepted_header_types, base, base1, base2, base3, base4, base5, base6, base7, base8, base9, i, j, k, len, ref, v; | ||
var accepted_header_types, base, base1, base10, base11, base2, base3, base4, base5, base6, base7, base8, base9, i, j, k, len, ref, v; | ||
if (options.high_water_mark) { | ||
// Convert Stream Readable options if underscored | ||
options.highWaterMark = options.high_water_mark; | ||
} | ||
if (options.object_mode) { | ||
options.objectMode = options.object_mode; | ||
} // Call parent constructor | ||
stream.Readable.call(this, options); // Clone and camelize options | ||
@@ -88,39 +99,48 @@ | ||
if ((base1 = this.options).maxWordLength == null) { | ||
base1.maxWordLength = 16; | ||
if ((base1 = this.options).delimiter == null) { | ||
base1.delimiter = ','; | ||
} | ||
if ((base2 = this.options).fixedSize == null) { | ||
base2.fixedSize = false; | ||
if ((base2 = this.options).duration == null) { | ||
base2.duration = null; | ||
} | ||
if ((base3 = this.options).end == null) { | ||
base3.end = null; | ||
if ((base3 = this.options).encoding == null) { | ||
base3.encoding = null; | ||
} | ||
if ((base4 = this.options).duration == null) { | ||
base4.duration = null; | ||
if ((base4 = this.options).end == null) { | ||
base4.end = null; | ||
} | ||
if ((base5 = this.options).seed == null) { | ||
base5.seed = false; | ||
if ((base5 = this.options).eof == null) { | ||
base5.eof = false; | ||
} | ||
if ((base6 = this.options).length == null) { | ||
base6.length = -1; | ||
if ((base6 = this.options).fixedSize == null) { | ||
base6.fixedSize = false; | ||
} | ||
if ((base7 = this.options).delimiter == null) { | ||
base7.delimiter = ','; | ||
if ((base7 = this.options).length == null) { | ||
base7.length = -1; | ||
} | ||
if ((base8 = this.options).rowDelimiter == null) { | ||
base8.rowDelimiter = '\n'; | ||
if ((base8 = this.options).maxWordLength == null) { | ||
base8.maxWordLength = 16; | ||
} | ||
if ((base9 = this.options).eof == null) { | ||
base9.eof = false; | ||
if ((base9 = this.options).rowDelimiter == null) { | ||
base9.rowDelimiter = '\n'; | ||
} | ||
if ((base10 = this.options).seed == null) { | ||
base10.seed = false; | ||
} | ||
if ((base11 = this.options).sleep == null) { | ||
base11.sleep = 0; | ||
} | ||
if (this.options.eof === true) { | ||
// Default values | ||
this.options.eof = this.options.rowDelimiter; | ||
@@ -278,3 +298,3 @@ } // State | ||
if (this.options.sleep) { | ||
if (this.options.sleep > 0) { | ||
return setTimeout(function () { | ||
@@ -281,0 +301,0 @@ return _this.push(record); |
@@ -70,3 +70,11 @@ // Generated by CoffeeScript 2.3.2 | ||
Generator = function(options = {}) { | ||
var accepted_header_types, base, base1, base2, base3, base4, base5, base6, base7, base8, base9, i, j, k, len, ref, v; | ||
var accepted_header_types, base, base1, base10, base11, base2, base3, base4, base5, base6, base7, base8, base9, i, j, k, len, ref, v; | ||
if (options.high_water_mark) { | ||
// Convert Stream Readable options if underscored | ||
options.highWaterMark = options.high_water_mark; | ||
} | ||
if (options.object_mode) { | ||
options.objectMode = options.object_mode; | ||
} | ||
// Call parent constructor | ||
stream.Readable.call(this, options); | ||
@@ -83,30 +91,37 @@ // Clone and camelize options | ||
} | ||
if ((base1 = this.options).maxWordLength == null) { | ||
base1.maxWordLength = 16; | ||
if ((base1 = this.options).delimiter == null) { | ||
base1.delimiter = ','; | ||
} | ||
if ((base2 = this.options).fixedSize == null) { | ||
base2.fixedSize = false; | ||
if ((base2 = this.options).duration == null) { | ||
base2.duration = null; | ||
} | ||
if ((base3 = this.options).end == null) { | ||
base3.end = null; | ||
if ((base3 = this.options).encoding == null) { | ||
base3.encoding = null; | ||
} | ||
if ((base4 = this.options).duration == null) { | ||
base4.duration = null; | ||
if ((base4 = this.options).end == null) { | ||
base4.end = null; | ||
} | ||
if ((base5 = this.options).seed == null) { | ||
base5.seed = false; | ||
if ((base5 = this.options).eof == null) { | ||
base5.eof = false; | ||
} | ||
if ((base6 = this.options).length == null) { | ||
base6.length = -1; | ||
if ((base6 = this.options).fixedSize == null) { | ||
base6.fixedSize = false; | ||
} | ||
if ((base7 = this.options).delimiter == null) { | ||
base7.delimiter = ','; | ||
if ((base7 = this.options).length == null) { | ||
base7.length = -1; | ||
} | ||
if ((base8 = this.options).rowDelimiter == null) { | ||
base8.rowDelimiter = '\n'; | ||
if ((base8 = this.options).maxWordLength == null) { | ||
base8.maxWordLength = 16; | ||
} | ||
if ((base9 = this.options).eof == null) { | ||
base9.eof = false; | ||
if ((base9 = this.options).rowDelimiter == null) { | ||
base9.rowDelimiter = '\n'; | ||
} | ||
if ((base10 = this.options).seed == null) { | ||
base10.seed = false; | ||
} | ||
if ((base11 = this.options).sleep == null) { | ||
base11.sleep = 0; | ||
} | ||
if (this.options.eof === true) { | ||
// Default values | ||
this.options.eof = this.options.rowDelimiter; | ||
@@ -245,3 +260,3 @@ } | ||
Generator.prototype.__push = function(record) { | ||
if (this.options.sleep) { | ||
if (this.options.sleep > 0) { | ||
return setTimeout(() => { | ||
@@ -248,0 +263,0 @@ return this.push(record); |
{ | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"name": "csv-generate", | ||
@@ -23,10 +23,14 @@ "description": "CSV and object generation implementing the Node.js `stream.Readable` API", | ||
"@babel/preset-env": "^7.1.0", | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^10.12.10", | ||
"@types/should": "^13.0.0", | ||
"coffeescript": "~2.3.2", | ||
"mocha": "~5.2.0", | ||
"should": "~13.2.3" | ||
"should": "~13.2.3", | ||
"ts-node": "^7.0.1", | ||
"typescript": "^3.1.6" | ||
}, | ||
"optionalDependencies": {}, | ||
"main": "./lib", | ||
"scripts": { | ||
"preversion": "rm -rf lib && npm test && grep '## Trunk' CHANGELOG.md", | ||
"preversion": "rm -rf lib/*.js && npm test && grep '## Trunk' CHANGELOG.md", | ||
"version": "version=`grep '^ \"version\": ' package.json | sed 's/.*\"\\([0-9\\.]*\\)\".*/\\1/'` && sed -i \"s/## Trunk/## Version $version/\" CHANGELOG.md && git add CHANGELOG.md", | ||
@@ -40,3 +44,4 @@ "postversion": "git push && git push --tags && npm publish", | ||
"test": "mocha test/**/*.coffee" | ||
} | ||
}, | ||
"types": "./lib/index.d.ts" | ||
} |
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
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
29509
16
775
11