Skip to content

fix(isAlphanumeric): include accented Greek letters for el-GR#2789

Open
greymoth-jp wants to merge 1 commit into
validatorjs:masterfrom
greymoth-jp:fix-isalphanumeric-el-gr-accents
Open

fix(isAlphanumeric): include accented Greek letters for el-GR#2789
greymoth-jp wants to merge 1 commit into
validatorjs:masterfrom
greymoth-jp:fix-isalphanumeric-el-gr-accents

Conversation

@greymoth-jp

Copy link
Copy Markdown

isAlpha('el-GR') and isAlphanumeric('el-GR') are meant to share the same letter set (alphanumeric is just the alpha letters plus digits), but their Greek ranges have drifted apart.

#1238 extended the alpha range to [Α-ώ] (U+0391-U+03CE) so it would accept accented letters. The alphanumeric range was never updated to match and still ends at ω: [0-9Α-ω] (U+0391-U+03C9).

Because of that gap, isAlphanumeric rejects ό (U+03CC), ύ (U+03CD) and ώ (U+03CE), plus the uppercase Ό/Ύ/Ώ (their case-folds sit just below the range), even though isAlpha accepts all of them. Those are very common letters, so words like νερό or πρώτα pass isAlpha('el-GR') but fail isAlphanumeric('el-GR').

This bumps the alphanumeric range to [0-9Α-ώ], matching the alpha class. The greek alpha test already lists άέήίΰϊϋόύώ and ΆΈΉΊΪΫΎΏ as valid, so I added the same strings to the greek alphanumeric test; they fail before this change and pass after it.

The el-GR alpha class was extended to [Α-ώ] in validatorjs#1238 to accept accented letters, but the sibling alphanumeric class still ends at ω ([Α-ω]). As a result isAlphanumeric rejects ό/ύ/ώ (and Ό/Ύ/Ώ) for el-GR while isAlpha accepts them. Match the range so the alphanumeric letter set equals the alpha set plus digits.
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a38f15b) to head (508be08).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2789   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2587      2587           
  Branches       656       656           
=========================================
  Hits          2587      2587           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

greymoth-jp added a commit to greymoth-jp/cjk-failure-corpus that referenced this pull request Jun 29, 2026
Add four greymoth PRs and one cited upstream PR, all verified open via the
GitHub API:
- BasedHardware/omi#8601 — onboarding answer gate counts a spaceless CJK
  answer as one word (segmentation)
- emdash-cms/emdash#1661 — editor footer word count / reading time splits
  on spaces, so a CJK paragraph reads as 1 word (segmentation)
- validatorjs/validator.js#2789 — isAlphanumeric el-GR range omits accented
  Greek that isAlpha accepts (unicode-range)
- date-fns/date-fns#4231 — Galician formats June as the wide form but cannot
  parse it back; the pattern stops before the tilde (locale-data)
- denoland/std#7183 — CsvParseStream leaves a leading BOM on the first header
  key while sync parse() strips it (encoding; cited, not greymoth-authored)

Three new categories: segmentation, unicode-range, encoding.
Status re-sync against the API: zag color-picker channel IME guard merged.
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