Skip to content

Instantly share code, notes, and snippets.

View bhelm's full-sized avatar

Bernd Helm bhelm

View GitHub Profile
@bhelm
bhelm / tocsv.js
Last active July 4, 2019 14:26 — forked from JeffJacobson/tocsv.js
JavaScript object to CSV
/**
* Converts a value to a string appropriate for entry into a CSV table. E.g., a string value will be surrounded by quotes.
* @param {string|number|object} theValue
*/
function toCsvValue(theValue) {
let t = typeof theValue,
output
let sDelimiter = '"'