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

Improve getCountryCode(), support special characters and trim any whitespace around the name #142

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

dmythro
Copy link
Member

@dmythro dmythro commented Jul 31, 2024

Issue #137

Refactor the getCountryCode function to handle special characters and symbols in country names. This ensures that the function can match country names accurately, even when they contain special characters or symbols. The function now escapes special RegExp characters and replaces hyphens with the appropriate escape sequence. Additionally, the function now trims leading and trailing spaces from the country name before matching it against the country data list.
@dmythro dmythro merged commit cc382a4 into main Jul 31, 2024
2 checks passed
@dmythro dmythro deleted the fix-get-code-regexp branch July 31, 2024 10:54
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