This file contains hidden or 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
| [ | |
| { | |
| "name": "Afeganistão", | |
| "dialCode": "+93", | |
| "emoji": "🇦🇫", | |
| "code": "AF" | |
| }, | |
| { | |
| "name": "África do Sul", | |
| "dialCode": "+27", |
This file contains hidden or 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
| function escapeRegex(search: string) { | |
| return search.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') | |
| } | |
| function normalizeString(str: string) { | |
| return str.normalize('NFD').replace(/[\u0300-\u036f]/g, '') | |
| } | |
| export function standardizeString(str: string) { | |
| return escapeRegex(normalizeString(String(str))) |