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

Function writeSuperblockStructure

curriculum/src/file-handler.ts:206–217  ·  view source on GitHub ↗
(
  superblock: string,
  structure: unknown
)

Source from the content-addressed store, hash-verified

204}
205
206export async function writeSuperblockStructure(
207 superblock: string,
208 structure: unknown
209) {
210 // dynamically importing prettier because Gatsby build and develop fail when
211 // it's required.
212 const prettier = await import('prettier');
213 const content = await prettier.format(JSON.stringify(structure), {
214 parser: 'json'
215 });
216 await writeFile(getSuperblockStructurePath(superblock), content);
217}
218
219export function getSuperblockStructure(superblockFilename: string) {
220 const superblockPath = getSuperblockStructurePath(superblockFilename);

Callers 3

renameBlockFunction · 0.90

Calls 1

Tested by

no test coverage detected