Closed jestanoff closed 6 years ago
We also intentionally remove the properties: https://github.com/braintree/credit-card-type/blob/e8c0125969bf4e07b2c442137d5e1cbc7f10023a/index.js#L38-L39
Thanks for bringing this up. I think it'd probably best to include an updateCard
method that allows you to modify the existing one, rather than trying to merge it.
Fair point, it is a feature request then. Thank you!
General information
Issue description
My intended use case is to modify existing card type VISA, add additional length of 11 but change nothing else:
with the above code I'm getting the following error:
If I include
prefixPattern/exactPattern
e.g.That issue is solved, still these properties shouldn't be overrided manually as they might change in feature releases of the package.
I narrowed down the issue in the clone() method that is using
JSON.stringify
to clone the types. RegEx object cannot be cloned with this method. https://github.com/braintree/credit-card-type/blob/master/index.js#L37