csv-parse
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -140,2 +140,4 @@ // Generated by CoffeeScript 1.10.0 | ||
this.count = 0; | ||
this.skipped_line_count = 0; | ||
this.empty_line_count = 0; | ||
this.is_int = /^(\-|\+)?([1-9]+[0-9]*)$/; | ||
@@ -205,4 +207,8 @@ this.is_float = function(value) { | ||
} | ||
if (line.length !== this.line_length && !this.options.relax_column_count && !(line.length === 1 && line[0] === '')) { | ||
if (this.options.columns != null) { | ||
if (line.length === 1 && line[0] === '') { | ||
this.empty_line_count++; | ||
} else if (line.length !== this.line_length) { | ||
if (this.options.relax_column_count) { | ||
this.skipped_line_count++; | ||
} else if (this.options.columns != null) { | ||
throw Error("Number of columns on line " + this.lines + " does not match header"); | ||
@@ -212,4 +218,5 @@ } else { | ||
} | ||
} else { | ||
this.count++; | ||
} | ||
this.count++; | ||
if (this.options.columns != null) { | ||
@@ -419,6 +426,6 @@ lineAsColumns = {}; | ||
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))); | ||
throw Error("Delimiter 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))); | ||
throw Error("Row delimiter not found in the file " + (JSON.stringify(this.options.rowDelimiter))); | ||
} | ||
@@ -437,3 +444,3 @@ } | ||
if (this.field.length > this.options.max_limit_on_data_read) { | ||
throw Error("Delimter not found in the file " + (JSON.stringify(this.options.delimiter))); | ||
throw Error("Delimiter not found in the file " + (JSON.stringify(this.options.delimiter))); | ||
} | ||
@@ -444,3 +451,3 @@ if (l === 0) { | ||
if (this.line.length > this.options.max_limit_on_data_read) { | ||
throw Error("Row delimter not found in the file " + (JSON.stringify(this.options.rowDelimiter))); | ||
throw Error("Row delimiter not found in the file " + (JSON.stringify(this.options.rowDelimiter))); | ||
} | ||
@@ -447,0 +454,0 @@ } |
{ | ||
"version": "1.1.4", | ||
"version": "1.1.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
23722
586