mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-12 01:00:13 -04:00
16 lines
361 B
TypeScript
16 lines
361 B
TypeScript
import {
|
|
ChallengeLang,
|
|
SuperBlocks,
|
|
superBlockToSpeechLang
|
|
} from '../../../shared/config/curriculum';
|
|
|
|
export const getLangFromSuperBlock = (
|
|
superBlock: SuperBlocks
|
|
): ChallengeLang => {
|
|
const lang = superBlockToSpeechLang[superBlock];
|
|
if (!lang) {
|
|
throw new Error(`Missing lang mapping for superBlock: ${superBlock}`);
|
|
}
|
|
return lang;
|
|
};
|