json2csvexporter
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -40,9 +40,36 @@ 'use strict'; | ||
_createClass(WriterService, [{ | ||
key: 'writeValue', | ||
key: 'wrapWithQuotes', | ||
/** | ||
* Returns the input string | ||
* @param {string} string - The input string. | ||
* @return {string} - A safe strings wrapped in quotes. | ||
*/ | ||
value: function wrapWithQuotes(string) { | ||
var safeString = string.replace(/"/g, '""'); | ||
return '"' + safeString + '"'; | ||
} | ||
/** | ||
* @param {*} value | ||
* @return {string} | ||
*/ | ||
}, { | ||
key: 'sanitizeValue', | ||
value: function sanitizeValue(value) { | ||
if (value === undefined || value === null || typeof value === 'function') { | ||
return ''; | ||
} | ||
return String(value); | ||
} | ||
/** | ||
* Pushes a new value into the current row. | ||
* @param {*} value - The value to push. | ||
*/ | ||
}, { | ||
key: 'writeValue', | ||
value: function writeValue(value) { | ||
@@ -97,29 +124,2 @@ var stringValue = this.sanitizeValue(value); | ||
} | ||
/** | ||
* Returns the input string | ||
* @param {string} string - The input string. | ||
* @return {string} - A safe strings wrapped in quotes. | ||
*/ | ||
}], [{ | ||
key: 'wrapWithQuotes', | ||
value: function wrapWithQuotes(string) { | ||
var safeString = string.replace(/"/g, '""'); | ||
return '"' + safeString + '"'; | ||
} | ||
/** | ||
* @param {*} value | ||
* @return {string} | ||
*/ | ||
}, { | ||
key: 'sanitizeValue', | ||
value: function sanitizeValue(value) { | ||
if (value === undefined || value === null || typeof value === 'function') { | ||
return ''; | ||
} | ||
return String(value); | ||
} | ||
}]); | ||
@@ -126,0 +126,0 @@ |
{ | ||
"name": "json2csvexporter", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"author": "Filip Danic <filip@spicefactory.com> (danicfilip.com)", | ||
@@ -5,0 +5,0 @@ "main": "lib/CSVExportService.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
41458
13