csv-parse
Advanced tools
Comparing version 5.3.2 to 5.3.3
class CsvError extends Error { | ||
constructor(code, message, options, ...contexts) { | ||
if(Array.isArray(message)) message = message.join(' '); | ||
if(Array.isArray(message)) message = message.join(' ').trim(); | ||
super(message); | ||
@@ -6,0 +6,0 @@ if(Error.captureStackTrace !== undefined){ |
@@ -64,3 +64,3 @@ | ||
parse: function(nextBuf, end, push, close){ | ||
const {bom, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; | ||
const {bom, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; | ||
let {comment, escape, quote, record_delimiter} = this.options; | ||
@@ -201,7 +201,10 @@ const {bomSkipped, previousBuf, rawBuffer, escapeIsQuote} = this.state; | ||
if(relax_quotes === false){ | ||
const info = this.__infoField(); | ||
const bom = Object.keys(boms).map(b => boms[b].equals(this.state.field.toString()) ? b : false).filter(Boolean)[0]; | ||
const err = this.__error( | ||
new CsvError('INVALID_OPENING_QUOTE', [ | ||
'Invalid Opening Quote:', | ||
`a quote is found inside a field at line ${this.info.lines}`, | ||
], this.options, this.__infoField(), { | ||
`a quote is found on field ${JSON.stringify(info.column)} at line ${info.lines}, value is ${JSON.stringify(this.state.field.toString(encoding))}`, | ||
bom ? `(${bom} bom)` : undefined | ||
], this.options, info, { | ||
field: this.state.field, | ||
@@ -208,0 +211,0 @@ }) |
{ | ||
"version": "5.3.2", | ||
"version": "5.3.3", | ||
"name": "csv-parse", | ||
@@ -127,3 +127,3 @@ "description": "CSV parsing implementing the Node.js `stream.Transform` API", | ||
}, | ||
"gitHead": "f5b1946347e762a84187c685a17773c06bf37565" | ||
"gitHead": "64895113de5e884a05f5d860ab63ed6b83fb240d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1324206
31031