From 1d247a21db9516c120038fa21d9143a77278d25d Mon Sep 17 00:00:00 2001 From: Dennis Boldt Date: Fri, 6 Jul 2018 23:48:22 +0200 Subject: [PATCH] Refactor variable srt to value --- papaparse.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/papaparse.js b/papaparse.js index 4b245b7..1b845d1 100755 --- a/papaparse.js +++ b/papaparse.js @@ -280,7 +280,7 @@ /** quote character */ var _quoteChar = '"'; - /** quote character */ + /** whether only strings should be quoted */ var _onlyQuoteStrings = false; unpackConfig(); @@ -412,20 +412,20 @@ } /** Encloses a value around quotes if needed (makes a value safe for CSV insertion) */ - function safe(str, col) + function safe(value, col) { - if (typeof str === 'undefined' || str === null) + if (typeof value === 'undefined' || value === null) return ''; - if (str.constructor === Date) - return JSON.stringify(str).slice(1, 25); + if (value.constructor === Date) + return JSON.stringify(value).slice(1, 25); - // We must check, whether the data type is string already here, + // We must check, whether the data type of value is string already here, // since all data types are converted into strings in the next line - var onlyQuoteStrings = _onlyQuoteStrings && typeof str === 'string'; + var onlyQuoteStrings = _onlyQuoteStrings && typeof value === 'string'; // Converts every data type to string - str = str.toString().replace(quoteCharRegex, _quoteChar + _quoteChar); + var str = value.toString().replace(quoteCharRegex, _quoteChar + _quoteChar); var needsQuotes = onlyQuoteStrings || (typeof _quotes === 'boolean' && _quotes)