Skip to content

Conversation

@yslpn
Copy link
Contributor

@yslpn yslpn commented Nov 8, 2025

PR: Accept 13-digit Visa Numbers

Summary

Implementation

  • Update CREDIT_CARD_REGEX to accept 13-19 consecutive digits while keeping grouped formats intact, so 13-digit Visa numbers reach provider-specific checks.
  • Retain downstream provider matching and Luhn verification, ensuring no regressions for other brands.

Testing

  • Existing unit test creditCard.test.ts already covers the 13-digit Visa sample 4007000000027;

Copilot AI review requested due to automatic review settings November 8, 2025 13:43
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Nov 8, 2025
@vercel
Copy link

vercel bot commented Nov 8, 2025

@yslpn is attempting to deploy a commit to the Valibot Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the fix A smaller enhancement or bug fix label Nov 8, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extends credit card validation to support 13-digit credit card numbers, specifically for Visa cards which can have 13 or 16-19 digits according to the payment card standard.

Key Changes:

  • Updated the credit card regex to accept 13-19 digit numbers (previously 14-19)
  • Added test coverage for a 13-digit Visa card number

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
library/src/actions/creditCard/creditCard.ts Modified the CREDIT_CARD_REGEX to support 13-digit card numbers by changing the minimum length from 14 to 13
library/src/actions/creditCard/creditCard.test.ts Added test case for a 13-digit Visa card number ('4007000000027') to verify the new validation range

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A smaller enhancement or bug fix size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

creditCard validator rejects valid 13‑digit Visa

1 participant