New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tidy up #82
Tidy up #82
Conversation
…dit card types into a json file for easy editting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I think it's a good move to split this large file into several smaller files, but I have a bunch of nitpicks I think should be addressed.
In addition, if we're pulling many of these things into units, now is probably the time to unit test those functions rather than treating them as private functions of the main module. If you do not want to do that work, we'll do that before merging in.
index.js
Outdated
@@ -1,296 +1,44 @@ | |||
'use strict'; | |||
|
|||
var types = require('./validator/cardTypes.json'); | |||
var clone = require('./validator/helpers/clone'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary to have all these nested inside a helpers
directory.
@crookedneighbor all valid points. I've made the suggested changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look great.
I just noticed that you have the file names in camel case. Braintree's normal style is to have file names in kebab case (lib/card-types.js
). Can you make that change?
Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! @crookedneighbor do you have thoughts vis a vis declaring a function then module.exports = function
vs module.exports = function () { }
?
I don't care that much. Usually, if it's a small function, all I'll just do: |
Will work on adding some additional tests for this on Friday. |
Didn't get a chance to work on this last week like I'd hoped. Will try to get this merged in this week. |
Merged in with 32c92e9 Made a few choices to combine some files. For instance, the Thanks for doing this chore! |
Refactored the code so it isn't all in one file. broke out functions and the card types