8 lines
276 B
TypeScript
8 lines
276 B
TypeScript
export function getCountryFlag(countryCode: string): string {
|
|
const code = countryCode.toUpperCase();
|
|
if (code.length === 2) {
|
|
const codePoints = [...code].map(char => 127397 + char.charCodeAt(0));
|
|
return String.fromCodePoint(...codePoints);
|
|
}
|
|
return '🏁';
|
|
} |