File size: 273 Bytes
20f83d9
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
export function normalizeCountryToken(value: unknown): string {
  return String(value || '')
    .normalize('NFKD')
    .replace(/\p{Diacritic}/gu, '')
    .toLowerCase()
    .replace(/&/g, ' and ')
    .replace(/[''.(),/-]/g, ' ')
    .replace(/\s+/g, ' ')
    .trim();
}