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

PhoneNumber scalar is not fully compatible with E.164 format so updated regex to support phone number with extension #2719

Merged
merged 3 commits into from
Jan 28, 2025

Conversation

nthombare-mdsol
Copy link
Contributor

@nthombare-mdsol nthombare-mdsol commented Jan 28, 2025

Description

Following recent discussions, it was determined that phone number support does not fully comply with E.164 standards. As a result, we also need to support phone extensions, which is addressed in this PR. Additionally, comprehensive test coverage has been added to cover all possible phone number formats.

The regex supports all phone numbers compliant with the E.164 international format standard, which includes country code (Optional), area codes, and local numbers and extension (optional). For more information on E.164 formatting,
Regex: https://regex101.com/r/nol2F6/1

Ex. +62 (21) 9175 5194, 2191755194, +1 123-456-7890 12345, +1 (123) 456-7890

Related #2709

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as
    expected)
  • This change requires a documentation update

Screenshots/Sandbox (if appropriate/relevant):

Adding links to sandbox or providing screenshots can help us understand more about this PR and take
action on it as appropriate

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can
reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Environment:

  • OS:
  • GraphQL Scalars Version:
  • NodeJS:

Checklist:

  • I have followed the
    CONTRIBUTING doc and the
    style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests and linter rules pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose
the solution you did and what alternatives you considered, etc...

Updated regex for E.164 compliant to support phone number with extension.
Updated regex for E.164 compliant to support phone number with extension.
@ardatan
Copy link
Collaborator

ardatan commented Jan 28, 2025

Thanks for the PR! 🙏🙏

@ardatan ardatan merged commit c7f58da into Urigo:master Jan 28, 2025
8 checks passed
@ris314
Copy link

ris314 commented Jan 28, 2025

When will this be released (published to npm)?

@dsengupta-mdsol
Copy link

This issue should be fixed with #2719. Will close the issue once we get a release. Thanks @nthombare-mdsol and @ardatan 🥳

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.

4 participants