Skip to content

fix(rules): allow multi-character values for da locale in alpha_num#5161

Open
greymoth-jp wants to merge 1 commit into
logaretm:mainfrom
greymoth-jp:fix/da-alpha-num-quantifier
Open

fix(rules): allow multi-character values for da locale in alpha_num#5161
greymoth-jp wants to merge 1 commit into
logaretm:mainfrom
greymoth-jp:fix/da-alpha-num-quantifier

Conversation

@greymoth-jp

Copy link
Copy Markdown

🔎 Overview

The da (Danish) entry in the alphanumeric table is missing the * quantifier, so alpha_num with locale: 'da' only matches a single character and rejects any real multi-character value.

// packages/rules/src/alpha_helper.ts
da: /^[0-9A-ZÆØÅ]$/i,   // before: matches exactly one char
da: /^[0-9A-ZÆØÅ]*$/i,  // after

This looks like a transcription typo, not an intended single-character rule:

  • Every other locale in the same alphanumeric table uses *.
  • The da entries in the sibling alpha, alphaSpaces, and alphaDash tables all already have *.
  • The upstream validator.js table this file is based on uses a quantifier for da-DK too (/^[0-9A-ZÆØÅ]+$/i).

🤓 Code snippets/examples (if applicable)

import alphaNum from '../src/alpha_num';

alphaNum('Søren', { locale: 'da' });  // false before this fix, true after
alphaNum('abc123', { locale: 'da' }); // false before this fix, true after
alphaNum('A', { locale: 'da' });      // true (single char, unchanged)

Added a regression test in alpha_num.spec.ts and a changeset. The rules package tests pass.

Issues affected

None filed.

@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9e34870

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@vee-validate/rules Patch
vee-validate Patch
@vee-validate/i18n Patch
@vee-validate/nuxt Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlify Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploy Preview for vee-validate-docs canceled.

Name Link
🔨 Latest commit 9e34870
🔍 Latest deploy log https://app.netlify.com/projects/vee-validate-docs/deploys/6a42e34e7eff4400086bdab7

@netlify

netlify Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploy Preview for vee-validate-v5 ready!

Name Link
🔨 Latest commit 9e34870
🔍 Latest deploy log https://app.netlify.com/projects/vee-validate-v5/deploys/6a42e34eb3aa8c0008c7e615
😎 Deploy Preview https://deploy-preview-5161--vee-validate-v5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant