Skip to content

fix(isMobilePhone): reject pipes in ko-KR numbers - #2963

Open
wonjangcloud9 wants to merge 1 commit into
validatorjs:masterfrom
wonjangcloud9:fix/mobile-phone-ko-kr-pipe
Open

wonjangcloud9 wants to merge 1 commit into
validatorjs:masterfrom
wonjangcloud9:fix/mobile-phone-ko-kr-pipe

Conversation

@wonjangcloud9

Copy link
Copy Markdown

The ko-KR pattern has the character class [0|1|6|7|8|9], which also matches a literal |:

isMobilePhone('01|-1234-5678', 'ko-KR'); // true, expected false
isMobilePhone('+82 1|12345678', 'ko-KR'); // true, expected false

This changes the class to [016789]. The digits it accepts are the same as before (010, 011, 016, 017, 018, 019).

Three invalid cases are added to the ko-KR test. The mobile phone test fails on master with "01|-1234-5678" passed but should have failed and passes with the change. I ran that test and eslint on the two changed files, not the full npm test.

#2950 fixes the same thing for vi-VN.

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9ff3424) to head (06ad731).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2963   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2599      2599           
  Branches       658       658           
=========================================
  Hits          2599      2599           

☔ 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.

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