feat(mask): implement credit card mask with expiry and CVV#95
Open
feat(mask): implement credit card mask with expiry and CVV#95
Conversation
Fixes the broken cartaocredito textMask (had a literal '0' instead of a space separator) and implements the full card data mask including expiry date (MM/YY) and CVV, matching the format expected by the existing validateBr.cartaocredito validator. - Standard 16-digit cards (Visa, MC, Discover, JCB): XXXX XXXX XXXX XXXX MM/YY CVV - Amex 15-digit cards (34xx/37xx): XXXX XXXXXX XXXXX MM/YY CVVV (4-digit CVV) - Uses textMaskFunction to detect card type from leading digits - Adds 7 unit tests covering all card brands and edge cases Closes #12 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d field - fakerBr.cartaocredito() generates a 23-digit string (16-digit card number + MMYY expiry + 3-digit CVV) for Visa, Mastercard, and Discover cards; output passes validateBr.cartaocredito and maskBr.cartaocredito - Adds faker tests: digit format check, validateBr round-trip, masked output shape check - Demo: adds credit card field to "Financeiro & Contato" section with live masking and validation; fakeCartaoCredito() inline generator drives the Gerar Dados button Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #12
cartaocreditotextMask(had a literal'0'character instead of a space before the expiry section)validateBr.cartaocreditoalready expectstextMaskFunctionon leading digitsFormats
XXXX XXXX XXXX XXXX MM/YY CVVXXXX XXXXXX XXXXX MM/YY CVVV(4-digit CVV)Test plan
37xxprefix → 15-digit format + 4-digit CVV34xxprefix → 15-digit format + 4-digit CVV🤖 Generated with Claude Code