1st version
This commit is contained in:
22
Jira_helper/node_modules/csv-parse/lib/api/CsvError.js
generated
vendored
Normal file
22
Jira_helper/node_modules/csv-parse/lib/api/CsvError.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
class CsvError extends Error {
|
||||
constructor(code, message, options, ...contexts) {
|
||||
if (Array.isArray(message)) message = message.join(" ").trim();
|
||||
super(message);
|
||||
if (Error.captureStackTrace !== undefined) {
|
||||
Error.captureStackTrace(this, CsvError);
|
||||
}
|
||||
this.code = code;
|
||||
for (const context of contexts) {
|
||||
for (const key in context) {
|
||||
const value = context[key];
|
||||
this[key] = Buffer.isBuffer(value)
|
||||
? value.toString(options.encoding)
|
||||
: value == null
|
||||
? value
|
||||
: JSON.parse(JSON.stringify(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { CsvError };
|
||||
Reference in New Issue
Block a user