Support toJSON() on read methods.#94
Conversation
|
@WaldoJeffers want to take a look? :) |
Codecov Report
@@ Coverage Diff @@
## master #94 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 11 11
Lines 1248 1257 +9
=====================================
+ Hits 1248 1257 +9
Continue to review full report at Codecov.
|
src/partial-result-stream.js
Outdated
| rowChunks = []; | ||
|
|
||
| if (options.toJSON) { | ||
| formattedRows = formattedRows.map(exec('toJSON')); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
As for passing arguments to
|
|
Didn't dig in too deeply to see if |
dc4fbaa to
0cfcee7
Compare
|
I've added
Tests added. Please take another look! |
|
@alexander-fenster would you mind taking another look? |
|
Since we haven't released this yet, I have a PR to rename |
Fixes #27
Provide
options.toJSON = truetodatabase.run,table.read, andtable.createReadStream, and all returned rows will already have hadtoJSONcalled on them.row.toJSON()supports options, such aswrapNumbers. To get these through, the user has to providetoJSONOption: {...}alongsidetoJSON: true.