Skip to content

fix(normalizer): check digit limits per country - #5

Merged
Cod3ddy merged 3 commits into
fix/input-prefixesfrom
fix/length-checks
Sep 30, 2026
Merged

Cod3ddy merged 3 commits into
fix/input-prefixesfrom
fix/length-checks

Conversation

@Cod3ddy

@Cod3ddy Cod3ddy commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Normalize now only formats. The global 7- and 12-digit limits are gone. They rejected real numbers in Germany, Finland, Italy and others, and kept Austria’s longest numbers out of reach.

NormalizeAndValidate formats a number and checks it against its country’s digit limits. ValidatePhoneNumber normalizes with the given country first, so it accepts local numbers too and no longer mistakes a local number for one that includes the code.

Breaking: Normalize("123") no longer returns an error, and MinimumLocalDigitsLength and MaximumLocalDigitsLength are removed. The README examples are corrected too.

@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