MCPcopy Index your code
hub / github.com/freeCodeCamp/freeCodeCamp / getChallengeIdsByBlock

Function getChallengeIdsByBlock

api/src/utils/get-challenges.ts:90–101  ·  view source on GitHub ↗
(blockId: string)

Source from the content-addressed store, hash-verified

88 * @returns An array of challenge IDs for the block, or empty array if block not found.
89 */
90export function getChallengeIdsByBlock(blockId: string): string[] {
91 const curricula = Object.values(curriculum);
92
93 for (const superBlock of curricula) {
94 const block = superBlock.blocks[blockId];
95 if (block) {
96 return block.challenges.map(challenge => challenge.id);
97 }
98 }
99
100 return [];
101}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected