This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Take an array of objects of similar structure and convert it to a CSV. | |
* @source https://halistechnology.com/2015/05/28/use-javascript-to-export-your-data-as-csv/ | |
* @modifiedBy sators | |
* @param {Array} options.data Array of data | |
* @param {String} options.columnDelimiter Column separator, defaults to "," | |
* @param {String} options.lineDelimiter Line break, defaults to "\n" | |
* @return {String} CSV | |
*/ | |
export default ({data = null, columnDelimiter = ",", lineDelimiter = "\n"}) => { |