csv-parse
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.8.0 | ||
// Generated by CoffeeScript 1.9.1 | ||
var Parser, stream, util; | ||
@@ -15,3 +15,3 @@ | ||
} else if (arguments.length === 2) { | ||
if (typeof arguments[0] === 'string') { | ||
if (typeof arguments[0] === 'string' || Buffer.isBuffer(arguments[0])) { | ||
data = arguments[0]; | ||
@@ -47,12 +47,12 @@ } else { | ||
parser.on('readable', function() { | ||
var chunk, _results; | ||
_results = []; | ||
var chunk, results; | ||
results = []; | ||
while (chunk = parser.read()) { | ||
if (options.objname) { | ||
_results.push(chunks[chunk[0]] = chunk[1]); | ||
results.push(chunks[chunk[0]] = chunk[1]); | ||
} else { | ||
_results.push(chunks.push(chunk)); | ||
results.push(chunks.push(chunk)); | ||
} | ||
} | ||
return _results; | ||
return results; | ||
}); | ||
@@ -73,3 +73,3 @@ parser.on('error', function(err) { | ||
Parser = function(options) { | ||
var _base, _base1, _base10, _base11, _base2, _base3, _base4, _base5, _base6, _base7, _base8, _base9; | ||
var base, base1, base10, base11, base2, base3, base4, base5, base6, base7, base8, base9; | ||
if (options == null) { | ||
@@ -81,37 +81,37 @@ options = {}; | ||
this.options = options; | ||
if ((_base = this.options).rowDelimiter == null) { | ||
_base.rowDelimiter = null; | ||
if ((base = this.options).rowDelimiter == null) { | ||
base.rowDelimiter = null; | ||
} | ||
if ((_base1 = this.options).delimiter == null) { | ||
_base1.delimiter = ','; | ||
if ((base1 = this.options).delimiter == null) { | ||
base1.delimiter = ','; | ||
} | ||
if ((_base2 = this.options).quote == null) { | ||
_base2.quote = '"'; | ||
if ((base2 = this.options).quote == null) { | ||
base2.quote = '"'; | ||
} | ||
if ((_base3 = this.options).escape == null) { | ||
_base3.escape = '"'; | ||
if ((base3 = this.options).escape == null) { | ||
base3.escape = '"'; | ||
} | ||
if ((_base4 = this.options).columns == null) { | ||
_base4.columns = null; | ||
if ((base4 = this.options).columns == null) { | ||
base4.columns = null; | ||
} | ||
if ((_base5 = this.options).comment == null) { | ||
_base5.comment = ''; | ||
if ((base5 = this.options).comment == null) { | ||
base5.comment = ''; | ||
} | ||
if ((_base6 = this.options).objname == null) { | ||
_base6.objname = false; | ||
if ((base6 = this.options).objname == null) { | ||
base6.objname = false; | ||
} | ||
if ((_base7 = this.options).trim == null) { | ||
_base7.trim = false; | ||
if ((base7 = this.options).trim == null) { | ||
base7.trim = false; | ||
} | ||
if ((_base8 = this.options).ltrim == null) { | ||
_base8.ltrim = false; | ||
if ((base8 = this.options).ltrim == null) { | ||
base8.ltrim = false; | ||
} | ||
if ((_base9 = this.options).rtrim == null) { | ||
_base9.rtrim = false; | ||
if ((base9 = this.options).rtrim == null) { | ||
base9.rtrim = false; | ||
} | ||
if ((_base10 = this.options).auto_parse == null) { | ||
_base10.auto_parse = false; | ||
if ((base10 = this.options).auto_parse == null) { | ||
base10.auto_parse = false; | ||
} | ||
if ((_base11 = this.options).skip_empty_lines == null) { | ||
_base11.skip_empty_lines = false; | ||
if ((base11 = this.options).skip_empty_lines == null) { | ||
base11.skip_empty_lines = false; | ||
} | ||
@@ -169,3 +169,3 @@ this.lines = 0; | ||
Parser.prototype.__push = function(line) { | ||
var field, i, lineAsColumns, _i, _len; | ||
var field, i, j, len, lineAsColumns; | ||
if (this.options.columns === true) { | ||
@@ -180,3 +180,3 @@ this.options.columns = line; | ||
lineAsColumns = {}; | ||
for (i = _i = 0, _len = line.length; _i < _len; i = ++_i) { | ||
for (i = j = 0, len = line.length; j < len; i = ++j) { | ||
field = line[i]; | ||
@@ -196,3 +196,3 @@ lineAsColumns[this.options.columns[i]] = field; | ||
Parser.prototype.__write = function(chars, end, callback) { | ||
var acceptedLength, areNextCharsRowDelimiters, char, escapeIsQuote, i, isDelimiter, isEscape, isNextCharAComment, isNextCharADelimiter, isQuote, isRowDelimiter, l, ltrim, nextCharPos, rowDelimiter, rowDelimiterLength, rtrim, wasCommenting, _results; | ||
var acceptedLength, areNextCharsRowDelimiters, char, escapeIsQuote, i, isDelimiter, isEscape, isNextCharAComment, isNextCharADelimiter, isQuote, isRowDelimiter, l, ltrim, nextCharPos, results, rowDelimiter, rowDelimiterLength, rtrim, wasCommenting; | ||
ltrim = this.options.trim || this.options.ltrim; | ||
@@ -344,8 +344,8 @@ rtrim = this.options.trim || this.options.rtrim; | ||
this.buf = ''; | ||
_results = []; | ||
results = []; | ||
while (i < l) { | ||
this.buf += chars.charAt(i); | ||
_results.push(i++); | ||
results.push(i++); | ||
} | ||
return _results; | ||
return results; | ||
}; |
{ | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"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
18429