Open jpetso opened 4 years ago
On second thought, maybe readFdfAsJSON()
is too broad, given that it sometimes also contains other information? How about readFormFieldValuesAsJSON()
(to leave room for readFormFieldInfoAsJSON()
for JSON-ified dump_data_fields_utf8
)?
Changed the function name to readFormFieldValuesAsJSON()
as mentioned above. Also fixed eslint issues.
Hi, and thanks for this library!
I took @ocallarob's excellent changes from PR #30, rebased them on current master to resolve the conflict, squashed his three commits into one and made a few tweaks of my own:
static fdfToJSON()
function isn't exposed by the module anymore. Instead, I introduced a new functionreadFdfAsJSON()
that can be used instead ofgenerateFdf().output()
and resolves the promise with the JSON directly. This allows more succinct code and imho fits better with the pure streaming API exposed by the rest of the module. Although returning a non-Buffer value from the promise is a new concept for this library, so please have a look if this is what you want.dump_data_fields_utf8
output. Which is also easier to parse./T
and/V
being swapped, uses a longer / less common pattern for line splitting).Thanks to @ocallarob for the original changeset, hopefully this moves it in the right direction.