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

Function addBlockStructure

curriculum/src/build-curriculum.ts:331–344  ·  view source on GitHub ↗
(
  superblocks: { name: SuperBlocks; blocks: BlockInfo[] }[],
  _getBlockStructure = getBlockStructure
)

Source from the content-addressed store, hash-verified

329type ProcessedBlock = BlockInfo & BlockStructure;
330
331export function addBlockStructure(
332 superblocks: { name: SuperBlocks; blocks: BlockInfo[] }[],
333 _getBlockStructure = getBlockStructure
334): { name: SuperBlocks; blocks: ProcessedBlock[] }[] {
335 return superblocks.map(superblock => ({
336 ...superblock,
337 blocks: superblock.blocks.map((block, index) => ({
338 ...block,
339 ..._getBlockStructure(block.dashedName),
340 order: index,
341 superBlock: superblock.name
342 }))
343 }));
344}
345
346/**
347 * Returns a list of all the superblocks that contain the given block

Callers 2

parseCurriculumStructureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected