euforic / banking.js

The Missing API for Banks - Get all of your transactions and balances using node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Would like to submit a pull request to make function parameters clearer

ChrisMagnuson opened this issue · comments

It has taken me a while to get my head around what lines like the following are doing:

Banking.prototype.getStatement = function(args, fn) {
  //Takes this.opts, mixes all of its properties into args and then returns args to be assigned to a local opts
  var opts = util.mixin(this.opts, args);
  //Uses the new local opts to create an ofxReq
  var ofxReq = ofx.createRequest(opts);

  var req = request
    //Uses the Banking version of opts not the local version
    .post(this.opts.url)

I would like to rewrite functions to use named parameters instead of an object that contains a lot of parameters to make these functions and ultimately this module easier to read and use and make calling things the right way more discoverable.

This would be a substantial change to the API of this module.

Would you be up for me submitting a pull request that rewrote things in this way?

The project is MIT licensed so you are welcome to fork the code and updated it however you would like for your use.
As for merging the proposed changes I would probably say no due to the fact that it would make the function signatures fairly large and also make it more complicated to add additional parameters. Thank you for submitting your proposal though.