From 99aeb8388db698ecdd3db80e1ace3fb4e0e41af8 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 12 May 2020 10:29:06 +0100 Subject: [PATCH] Update src/phonenumber.ts Co-authored-by: Travis Ralston --- src/phonenumber.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/phonenumber.ts b/src/phonenumber.ts index fd189f8d39..6dd44a3c12 100644 --- a/src/phonenumber.ts +++ b/src/phonenumber.ts @@ -36,6 +36,7 @@ const COUNTRY_CODE_REGEX = /^[A-Z]{2}$/; export const getEmojiFlag = (countryCode: string) => { if (!COUNTRY_CODE_REGEX.test(countryCode)) return ''; + // Rip the country code out of the emoji and use that return String.fromCodePoint(...countryCode.split('').map(l => UNICODE_BASE + l.charCodeAt(0))); };