Skip to content

feat(isMobilePhone): add en-TK (Tokelau) validation - #2935

Open
tjt253856563-glitch wants to merge 1 commit into
validatorjs:masterfrom
tjt253856563-glitch:feat/tokelau-mobile-validation
Open

tjt253856563-glitch wants to merge 1 commit into
validatorjs:masterfrom
tjt253856563-glitch:feat/tokelau-mobile-validation

Conversation

@tjt253856563-glitch

Copy link
Copy Markdown

Add en-TK mobile phone validation for Tokelau, accepting prefixes 72, 73 and 74 with 4–7 national digits and an optional +690/690 country code. Update the documented locale list and cover length/prefix boundaries, country-code variants, strict mode, locale arrays, any and locale enumeration.

Numbering reference: ITU Tokelau national numbering plan, communication of 6 December 2015. It lists those mobile prefixes and lengths. This validates number format, not whether a number is assigned.

Refs #1761. This addresses only the Tokelau subtask and does not close the multi-country tracking issue.

Validation on 9ff342479591ca5a43cb30000195bcf55c1bbed9, Windows 11, Node 24.19.0:

  • The same three regression tests fail on the baseline with Invalid locale 'en-TK' and pass after the change.
  • npm test passes, including Node/ES/browser builds, ESLint and 326 tests.

Checklist

  • PR contains only related source, test and documentation changes.
  • README locale list updated.
  • Tests written and executed.
  • Numbering reference provided.

Implementation and test preparation used AI assistance.

@codecov

codecov Bot commented Oct 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 (60a1b89).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2935   +/-   ##
=========================================
  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