-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters