Socket
Socket
Sign inDemoInstall

csv-parse

Package Overview
Dependencies
0
Maintainers
1
Versions
141
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.5 to 1.0.6

38

lib/index.js

@@ -79,3 +79,3 @@ // Generated by CoffeeScript 1.10.0

Parser = function(options) {
var base, base1, base10, base11, base12, base13, base2, base3, base4, base5, base6, base7, base8, base9, k, v;
var base, base1, base10, base11, base12, base13, base14, base15, base2, base3, base4, base5, base6, base7, base8, base9, k, v;
if (options == null) {

@@ -127,8 +127,14 @@ options = {};

}
if ((base12 = this.options).skip_empty_lines == null) {
base12.skip_empty_lines = false;
if ((base12 = this.options).relax == null) {
base12.relax = false;
}
if ((base13 = this.options).max_limit_on_data_read == null) {
base13.max_limit_on_data_read = 128000;
if ((base13 = this.options).relax_column_count == null) {
base13.relax_column_count = true;
}
if ((base14 = this.options).skip_empty_lines == null) {
base14.skip_empty_lines = false;
}
if ((base15 = this.options).max_limit_on_data_read == null) {
base15.max_limit_on_data_read = 128000;
}
this.lines = 0;

@@ -190,12 +196,2 @@ 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) {

@@ -208,2 +204,12 @@ this.options.columns = line;

}
if (!this.line_length && line.length > 0) {
this.line_length = this.options.columns ? this.options.columns.length : line.length;
}
if (!this.options.relax_column_count && line.length !== this.line_length) {
if (this.options.columns != null) {
this.emit('error', Error("Number of columns on line " + this.lines + " does not match header"));
} else {
this.emit('error', Error("Number of columns is inconsistent on line " + (this.lines + 1)));
}
}
this.count++;

@@ -340,3 +346,3 @@ if (this.options.columns != null) {

isRowDelimiter = this.options.rowDelimiter && chars.substr(i, this.options.rowDelimiter.length) === this.options.rowDelimiter;
if (isRowDelimiter) {
if (isRowDelimiter || (end && i === l - 1)) {
this.lines++;

@@ -343,0 +349,0 @@ }

{
"version": "1.0.5",
"version": "1.0.6",
"name": "csv-parse",

@@ -4,0 +4,0 @@ "description": "CSV parsing implementing the Node.js `stream.Transform` API",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc