fix(isAlphanumeric): include accented Greek letters for el-GR#2789
Open
greymoth-jp wants to merge 1 commit into
Open
fix(isAlphanumeric): include accented Greek letters for el-GR#2789greymoth-jp wants to merge 1 commit into
greymoth-jp wants to merge 1 commit into
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.
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.
isAlpha('el-GR')andisAlphanumeric('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,
isAlphanumericrejectsό(U+03CC),ύ(U+03CD) andώ(U+03CE), plus the uppercaseΌ/Ύ/Ώ(their case-folds sit just below the range), even thoughisAlphaaccepts all of them. Those are very common letters, so words likeνερόorπρώταpassisAlpha('el-GR')but failisAlphanumeric('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.