(locale: PropertyKey)
| 118 | // find the associated enum values |
| 119 | |
| 120 | export function getLangCode(locale: PropertyKey): string { |
| 121 | if (isPropertyOf(LangCodes, locale)) return LangCodes[locale]; |
| 122 | throw new Error(`${String(locale)} is not a valid locale`); |
| 123 | } |
| 124 | |
| 125 | function isPropertyOf<O>( |
| 126 | obj: Record<string, string>, |
no test coverage detected