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

Commits on Jul 31, 2024

  1. refactor: Improve getCountryCode function

    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 committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    522b2eb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6698b0c View commit details
    Browse the repository at this point in the history