|
|
|
@ -447,17 +447,17 @@ License: MIT
@@ -447,17 +447,17 @@ License: MIT
|
|
|
|
|
if (str.constructor === Date) |
|
|
|
|
return JSON.stringify(str).slice(1, 25); |
|
|
|
|
|
|
|
|
|
str = str.toString().replace(quoteCharRegex, _escapedQuote); |
|
|
|
|
var escapedQuoteStr = str.toString().replace(quoteCharRegex, _escapedQuote); |
|
|
|
|
|
|
|
|
|
var needsQuotes = (typeof _quotes === 'boolean' && _quotes) |
|
|
|
|
|| (typeof _quotes === 'function' && _quotes(str, col)) |
|
|
|
|
|| (Array.isArray(_quotes) && _quotes[col]) |
|
|
|
|
|| hasAny(str, Papa.BAD_DELIMITERS) |
|
|
|
|
|| str.indexOf(_delimiter) > -1 |
|
|
|
|
|| str.charAt(0) === ' ' |
|
|
|
|
|| str.charAt(str.length - 1) === ' '; |
|
|
|
|
|| hasAny(escapedQuoteStr, Papa.BAD_DELIMITERS) |
|
|
|
|
|| escapedQuoteStr.indexOf(_delimiter) > -1 |
|
|
|
|
|| escapedQuoteStr.charAt(0) === ' ' |
|
|
|
|
|| escapedQuoteStr.charAt(escapedQuoteStr.length - 1) === ' '; |
|
|
|
|
|
|
|
|
|
return needsQuotes ? _quoteChar + str + _quoteChar : str; |
|
|
|
|
return needsQuotes ? _quoteChar + escapedQuoteStr + _quoteChar : escapedQuoteStr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function hasAny(str, substrings) |
|
|
|
|