Closed wuestkamp closed 5 years ago
I don't think I understand what you need. Why can't you call CreditCardType()
directly?
Well, this one doesn't seem to be accessible:
console.log(CreditCardType.CreditCardType('4111'));
console: Uncaught TypeError: CreditCardType.CreditCardType is not a function
console.log(CreditCardType.creditCardType('4111'));
console: Uncaught TypeError: CreditCardType.creditCardType is not a function
Just those methods defined using creditCardType.X
are available.
Thanks! Kim
When credit-card-type is loaded, the api should just be
> var creditCardType = require('credit-card-type');
> creditCardType('4111');
[ { niceType: 'Visa',
type: 'visa',
patterns: [ 4 ],
gaps: [ 4, 8, 12 ],
lengths: [ 16, 18, 19 ],
code: { name: 'CVV', size: 3 },
matchStrength: 1 } ]
There's no need to index into the module to find a method named "creditCardType".
If you are still having trouble, could you post a command line example of what you're trying to do with requirejs?
Hey!
I know this has already been discussed in other tickets, but what speaks against adding this method:
So that its possible to access this when (for example) loaded via RequireJS? Then I can do this in RequireJS:
Where credi
Thanks a lot! Kim