csv-parse
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -16,2 +16,8 @@ // Generated by CoffeeScript 1.9.1 | ||
callback = arguments[2]; | ||
if (typeof callback !== 'function') { | ||
throw Error("Invalid callback argument: " + (JSON.stringify(callback))); | ||
} | ||
if (typeof data !== 'string') { | ||
return callback(Error("Invalid data argument: " + (JSON.stringify(data)))); | ||
} | ||
} else if (arguments.length === 2) { | ||
@@ -200,3 +206,3 @@ if (typeof arguments[0] === 'string' || Buffer.isBuffer(arguments[0])) { | ||
Parser.prototype.__write = function(chars, end, callback) { | ||
var acceptedLength, areNextCharsRowDelimiters, char, escapeIsQuote, i, isDelimiter, isEscape, isNextCharAComment, isNextCharADelimiter, isQuote, isRowDelimiter, l, ltrim, nextCharPos, ref, results, rowDelimiter, rowDelimiterLength, rtrim, wasCommenting; | ||
var acceptedLength, areNextCharsDelimiter, areNextCharsRowDelimiters, char, escapeIsQuote, i, isDelimiter, isEscape, isNextCharAComment, isQuote, isRowDelimiter, l, ltrim, nextCharPos, ref, results, rowDelimiter, rowDelimiterLength, rtrim, wasCommenting; | ||
ltrim = this.options.trim || this.options.ltrim; | ||
@@ -253,5 +259,5 @@ rtrim = this.options.trim || this.options.rtrim; | ||
areNextCharsRowDelimiters = this.options.rowDelimiter && chars.substr(i + 1, this.options.rowDelimiter.length) === this.options.rowDelimiter; | ||
isNextCharADelimiter = chars.substr(i + 1, this.options.delimiter.length) === this.options.delimiter; | ||
areNextCharsDelimiter = chars.substr(i + 1, this.options.delimiter.length) === this.options.delimiter; | ||
isNextCharAComment = this.nextChar === this.options.comment; | ||
if (this.nextChar && !areNextCharsRowDelimiters && !isNextCharADelimiter && !isNextCharAComment) { | ||
if (this.nextChar && !areNextCharsRowDelimiters && !areNextCharsDelimiter && !isNextCharAComment) { | ||
if (this.options.relax) { | ||
@@ -261,3 +267,3 @@ this.quoting = false; | ||
} else { | ||
throw new Error("Invalid closing quote at line " + (this.lines + 1) + "; found " + (JSON.stringify(this.nextChar)) + " instead of delimiter " + (JSON.stringify(this.options.delimiter))); | ||
throw Error("Invalid closing quote at line " + (this.lines + 1) + "; found " + (JSON.stringify(this.nextChar)) + " instead of delimiter " + (JSON.stringify(this.options.delimiter))); | ||
} | ||
@@ -278,3 +284,3 @@ } else { | ||
} else if (this.field && !this.options.relax) { | ||
throw new Error("Invalid opening quote at line " + (this.lines + 1)); | ||
throw Error("Invalid opening quote at line " + (this.lines + 1)); | ||
} | ||
@@ -281,0 +287,0 @@ } |
{ | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"name": "csv-parse", | ||
@@ -24,6 +24,3 @@ "description": "CSV parsing implementing the Node.js `stream.Transform` API", | ||
], | ||
"licenses": [{ | ||
"type": "BSD", | ||
"url": "https://github.com/wdavidw/node-csv-parse/blob/master/LICENSE" | ||
}], | ||
"licenses": "BSD-3-Clause", | ||
"repository": { | ||
@@ -37,7 +34,7 @@ "type": "git", | ||
"each": "0.5.0", | ||
"coffee-script": "1.9.1", | ||
"coffee-script": "1.9.3", | ||
"csv-generate": "0.0.4", | ||
"csv-spectrum": "0.2.0", | ||
"mocha": "2.1.0", | ||
"should": "5.0.0" | ||
"mocha": "2.2.5", | ||
"should": "6.0.3" | ||
}, | ||
@@ -44,0 +41,0 @@ "optionalDependencies": {}, |
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
19116
453