fixing csv serialization and minor style tweaks

This commit is contained in:
maxogden
2011-03-09 23:16:57 -08:00
parent bf57648c96
commit b3dbaa0ec3
5 changed files with 21 additions and 16 deletions

View File

@@ -19,7 +19,7 @@ function(head, req) {
if (row.value[headers[header]]) {
if (startedOutput) send(",");
var value = row.value[headers[header]];
if (typeof(value) == "object") value = JSON.stringify(value).replace(/"/g, '\\"');
if (typeof(value) == "object") value = JSON.stringify(value).replace(/"/g, "\\\"");
send("\"" + value + "\"");
} else {
if (startedOutput) send(",");