braintree / credit-card-type

A library for determining credit card type
MIT License
980 stars 154 forks source link

Tidy up #82

Closed petecraven91 closed 5 years ago

petecraven91 commented 6 years ago

Refactored the code so it isn't all in one file. broke out functions and the card types

petecraven91 commented 6 years ago

@crookedneighbor all valid points. I've made the suggested changes I agree this is the ideal time to add testing for each function, just don't have the time to do it right now but can look at doing this for future pull requests

petecraven91 commented 6 years ago

Thanks Updated to kebab case

crookedneighbor commented 6 years ago

I don't care that much.

Usually, if it's a small function, all I'll just do: module.exports = function () {} and if it's longer, I'll name it.

crookedneighbor commented 6 years ago

Will work on adding some additional tests for this on Friday.

crookedneighbor commented 6 years ago

Didn't get a chance to work on this last week like I'd hoped. Will try to get this merged in this week.

crookedneighbor commented 5 years ago

Merged in with https://github.com/braintree/credit-card-type/commit/32c92e97ad6d5857839872791391d38db64548c1

Made a few choices to combine some files. For instance, the matchesPattern and matchesRange functions could be considered private methods of the matches module, so I moved them in there and made sure to test both cases in the test file for matches.

Thanks for doing this chore!