Closed andynoelker closed 7 years ago
This is something we considered when building the library, but decided against it for two reasons.
We don't want to allow numbers to be passed in because credit card numbers can, in theory, start with 0
. We also have to convert everything to a string anyway because we need to match things against regular expressions.
@EvanHahn Fair enough. It looked to me like the library simply returns an empty array for anything that is not a string rather than convert like you just mentioned. Maybe throwing some kind of descriptive warning would be good? Probably not too big of a deal.
This library requires that a string be passed in as input. I see no reason why this shouldn't be allowed:
This would be helpful in instances where this library is used internally within app logic and not receiving direct user input.
I'm happy to submit a PR to add this in. As I see the project uses string properties such as
length
, my PR would essentially cast a numerical input to a string first.