wdavidw/node-csv-parser — Issue #17: transformed objects with boolean field values die
Author: rektide
Created: 2011-12-21 21:42:47+00:00
State: open

using the transform(transformer) as specified below:

function transformer(incoming) {
return {one:incoming[0],
two:incoming[1]=="True" }
}

throws an error:

TypeError: Object true has no method 'indexOf'
at /opt/foo/node_modules/csv/lib/csv.js:253:55
at Array.forEach (native)
at write (/opt/foo/node_modules/csv/lib/csv.js:242:22)
at flush (/opt/foo/node_modules/csv/lib/csv.js:407:9)
at parse (/opt/foo//node_modules/csv/lib/csv.js:366:21)
at [object Object]. (/opt/foo/node_modules/csv/lib/csv.js:92:17)
at [object Object].emit (events.js:67:17)
at [object Object]._emitData (fs.js:1117:29)
at afterRead (fs.js:1101:10)
at Object.wrapper [as oncomplete] (fs.js:252:17)