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

Fix PhoneNumber regex to support more countries #129

Merged
merged 2 commits into from
Oct 16, 2019
Merged

Conversation

ardatan
Copy link
Collaborator

@ardatan ardatan commented Oct 16, 2019

Related #124

@@ -2,7 +2,7 @@ import { GraphQLScalarType } from 'graphql';
import { GraphQLError } from 'graphql/error';
import { Kind } from 'graphql/language';

const PHONE_NUMBER_REGEX = /^\+?[1-9]\d{1,14}$/;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for keeping the \+ as non-optional. I think it would have been a breaking change otherwise, especially since many parsing libraries fail without it.

Copy link
Collaborator Author

@ardatan ardatan Oct 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's why I keep it required :)

@ardatan ardatan merged commit 81180da into master Oct 16, 2019
@ardatan ardatan deleted the fix/phone-number branch October 16, 2019 05:34
vespertilian pushed a commit to vespertilian/graphql-scalars that referenced this pull request Oct 2, 2020
* Fix PhoneNumber regex to support more countries

* Fix tests
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.

2 participants