We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider extracting credit card validation logic into a separate module.
The credit card validation logic can be extracted to reduce complexity while maintaining functionality. For example:
// CreditCardValidator.js export class CreditCardValidator { validate(value) { const card = this.matchCard(value); return { maxLength: card.formatLength, minLength: card.formatMinLength, icon: card.cardIcon, isValid: this.validateCard(value, card) }; } matchCard(value) { // Credit card matching logic moved here } } // BaseInput.js import { CreditCardValidator } from './CreditCardValidator'; export default class BaseInput extends LitElement { constructor() { super(); this.creditCardValidator = new CreditCardValidator(); } processCreditCard() { const result = this.creditCardValidator.validate(this.value); this.maxLength = result.maxLength; this.minLength = result.minLength; this.inputIconName = result.icon; } }
This separates concerns while keeping all functionality intact. The credit card validation is encapsulated in its own module with a clear interface.
Originally posted by @sourcery-ai[bot] in #16 (comment)
The text was updated successfully, but these errors were encountered:
https://github.com/AlaskaAirlines/auro-input/blob/main/src/base-input.js#L856-L960
Sorry, something went wrong.
No branches or pull requests
Consider extracting credit card validation logic into a separate module.
The credit card validation logic can be extracted to reduce complexity while maintaining functionality. For example:
This separates concerns while keeping all functionality intact. The credit card validation is encapsulated in its own module with a clear interface.
Originally posted by @sourcery-ai[bot] in #16 (comment)
The text was updated successfully, but these errors were encountered: