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

Function writeBlockStructure

curriculum/src/file-handler.ts:196–204  ·  view source on GitHub ↗
(block: string, structure: unknown)

Source from the content-addressed store, hash-verified

194}
195
196export async function writeBlockStructure(block: string, structure: unknown) {
197 // dynamically importing prettier because Gatsby build and develop fail when
198 // it's required.
199 const prettier = await import('prettier');
200 const content = await prettier.format(JSON.stringify(structure), {
201 parser: 'json'
202 });
203 await writeFile(getBlockStructurePath(block), content, 'utf8');
204}
205
206export async function writeSuperblockStructure(
207 superblock: string,

Callers 6

createMetaJsonFunction · 0.90
createMetaJsonFunction · 0.90
createMetaJsonFunction · 0.90
renameBlockFunction · 0.90
updateMetaDataFunction · 0.90

Calls 1

getBlockStructurePathFunction · 0.85

Tested by

no test coverage detected