csv-parse
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -79,3 +79,3 @@ // Generated by CoffeeScript 1.10.0 | ||
Parser = function(options) { | ||
var base, base1, base10, base11, base12, base2, base3, base4, base5, base6, base7, base8, base9, k, v; | ||
var base, base1, base10, base11, base12, base13, base2, base3, base4, base5, base6, base7, base8, base9, k, v; | ||
if (options == null) { | ||
@@ -130,2 +130,5 @@ options = {}; | ||
} | ||
if ((base13 = this.options).max_limit_on_data_read == null) { | ||
base13.max_limit_on_data_read = 128000; | ||
} | ||
this.lines = 0; | ||
@@ -187,2 +190,12 @@ this.count = 0; | ||
var field, i, j, len, lineAsColumns; | ||
if (!this.line_length && line.length > 0) { | ||
this.line_length = line.length; | ||
} | ||
if (line.length !== this.line_length) { | ||
if (this.options.columns != null) { | ||
this.emit('error', new Error("Number of columns on line " + (this.lines + 1) + " does not match header")); | ||
} else { | ||
this.emit('error', new Error("Number of columns is inconsistent on line " + (this.lines + 1))); | ||
} | ||
} | ||
if (this.options.columns === true) { | ||
@@ -388,2 +401,8 @@ this.options.columns = line; | ||
} | ||
if (!this.commenting && this.field.length > this.options.max_limit_on_data_read) { | ||
throw Error("Delimter not found in the file " + (JSON.stringify(this.options.delimiter))); | ||
} | ||
if (!this.commenting && this.line.length > this.options.max_limit_on_data_read) { | ||
throw Error("Row delimter not found in the file " + (JSON.stringify(this.options.rowDelimiter))); | ||
} | ||
} | ||
@@ -390,0 +409,0 @@ this.buf = ''; |
{ | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"name": "csv-parse", | ||
@@ -4,0 +4,0 @@ "description": "CSV parsing implementing the Node.js `stream.Transform` API", |
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
22075
543