Skip to content

fix(normalizer): strip each country's own trunk prefix once - #6

Merged
Cod3ddy merged 2 commits into
fix/length-checksfrom
fix/trunk-prefix
Sep 30, 2026
Merged

Cod3ddy merged 2 commits into
fix/length-checksfrom
fix/trunk-prefix

Conversation

@Cod3ddy

@Cod3ddy Cod3ddy commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Adds internal/cmd/gencountries, which fills countries.json from libphonenumber v9.0.40: international prefix, trunk prefix, number pattern and main country for shared codes.

A local number now loses only its own country’s trunk prefix, and only once: 0 in Malawi, 8 in Russia, 06 in Hungary, nothing in Italy or Côte d’Ivoire, where the leading 0 is part of the number. As in libphonenumber, the prefix is kept when the number as typed is already valid, so Russian 800 numbers and Rwandan 06 numbers stay whole.

@Cod3ddy
Cod3ddy added this pull request to stack #8 September 29, 2026 21:29
@Cod3ddy
Cod3ddy merged commit 426f681 into main Sep 30, 2026
3 checks passed
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