|
|
@ -273,6 +273,9 @@ License: MIT |
|
|
|
/** quote character */ |
|
|
|
/** quote character */ |
|
|
|
var _quoteChar = '"'; |
|
|
|
var _quoteChar = '"'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** escaped quote character, either "" or <config.escapeChar>" */ |
|
|
|
|
|
|
|
var _escapedQuote = _quoteChar + _quoteChar; |
|
|
|
|
|
|
|
|
|
|
|
/** whether to skip empty lines */ |
|
|
|
/** whether to skip empty lines */ |
|
|
|
var _skipEmptyLines = false; |
|
|
|
var _skipEmptyLines = false; |
|
|
|
|
|
|
|
|
|
|
@ -343,6 +346,10 @@ License: MIT |
|
|
|
|
|
|
|
|
|
|
|
if (typeof _config.header === 'boolean') |
|
|
|
if (typeof _config.header === 'boolean') |
|
|
|
_writeHeader = _config.header; |
|
|
|
_writeHeader = _config.header; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_config.escapeChar !== undefined) { |
|
|
|
|
|
|
|
_escapedQuote = _config.escapeChar + _quoteChar; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -429,7 +436,7 @@ License: MIT |
|
|
|
if (str.constructor === Date) |
|
|
|
if (str.constructor === Date) |
|
|
|
return JSON.stringify(str).slice(1, 25); |
|
|
|
return JSON.stringify(str).slice(1, 25); |
|
|
|
|
|
|
|
|
|
|
|
str = str.toString().replace(quoteCharRegex, _quoteChar + _quoteChar); |
|
|
|
str = str.toString().replace(quoteCharRegex, _escapedQuote); |
|
|
|
|
|
|
|
|
|
|
|
var needsQuotes = (typeof _quotes === 'boolean' && _quotes) |
|
|
|
var needsQuotes = (typeof _quotes === 'boolean' && _quotes) |
|
|
|
|| (Array.isArray(_quotes) && _quotes[col]) |
|
|
|
|| (Array.isArray(_quotes) && _quotes[col]) |
|
|
|