Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a number is in an unexpected format, fallback to a standard (sanitized) number #18

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

imbrianj
Copy link
Collaborator

We base the formatting off the number of digits in a given phone number matched against the number of digit placeholders in any available phone format for a given region. An issue could arise when a yet-to-be-defined format is expected but not available, and forcing an overly-long phone number to be transposed into a number format, and leading digits could be omitted. With this change, an unexpected format will return as a plain-text, unformatted number that has gone through sanitization so it can safely be rendered. The one exception to this is region code 1, where adding the region code is uncommon, domestically. Tests added to cover this corner-case.

@imbrianj imbrianj requested review from mi4l and DerekWW as code owners October 31, 2024 23:16
@imbrianj imbrianj merged commit aaa4867 into main Nov 1, 2024
3 checks passed
@imbrianj imbrianj deleted the unexpectedFormat branch November 1, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants