MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / getLangCode

Function getLangCode

packages/shared/src/config/i18n.ts:120–123  ·  view source on GitHub ↗
(locale: PropertyKey)

Source from the content-addressed store, hash-verified

118// find the associated enum values
119
120export 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
125function isPropertyOf<O>(
126 obj: Record<string, string>,

Callers 5

heat-map.tsxFile · 0.90
heat-map.test.tsxFile · 0.90
time-line.tsxFile · 0.90
utils.tsFile · 0.90

Calls 1

isPropertyOfFunction · 0.85

Tested by

no test coverage detected