You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Returns a formatter that will format json data to file type specified by the extension in `filePath`. Used internally by {@link writeData} and {@link writeDataSync}.
*
* @function discernFileFormatter
* @param {String} filePath Input file path
* @returns {Function} A formatter function that will write the extension format
*
* @example
* var formatter = io.discernFileFormatter('path/to/data.tsv')
* var csv = formatter(json)
*/
export default function discernFileFormatter (filePath) {
var format = discernFormat(filePath)
var formatter = formatters[format]
// If we don't have a parser for this format, return as text