From a8354040bfd945bf68f5cbc383f79773a2ad4a63 Mon Sep 17 00:00:00 2001 From: koteelok Date: Sat, 28 Sep 2024 13:15:15 +0300 Subject: [PATCH] Fix missing ysdk typing --- static/assets/common/localization.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/static/assets/common/localization.ts b/static/assets/common/localization.ts index 5b658cb..d96c850 100644 --- a/static/assets/common/localization.ts +++ b/static/assets/common/localization.ts @@ -1,5 +1,3 @@ -import { TopLevelDomain } from "ysdk"; - export const LanguageCode = { AF: "af", AM: "am", @@ -393,8 +391,6 @@ const TLD2LangCodeMap = { tm: "tk", ua: "uk", uz: "uz", -} as const; +} as Record; -export const domainToLanguageCode = ( - domain: T -): (typeof TLD2LangCodeMap)[T] => TLD2LangCodeMap[domain]; +export const domainToLanguageCode = (domain: string): string => TLD2LangCodeMap[domain] ?? "en";