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

Function transformContents

packages/shared/src/utils/polyvinyl.ts:118–125  ·  view source on GitHub ↗
(
  wrap: Wrapper,
  polyP: ChallengeFile | Promise<ChallengeFile>
)

Source from the content-addressed store, hash-verified

116// already contains a source, this version will continue as
117// the source property
118export async function transformContents(
119 wrap: Wrapper,
120 polyP: ChallengeFile | Promise<ChallengeFile>
121) {
122 const poly = await polyP;
123 const newPoly = setContent(await wrap(poly.contents), poly, poly.source);
124 return newPoly;
125}
126
127// createSource(poly: PolyVinyl) => PolyVinyl
128export function createSource<Rest>(

Callers 4

getJSTranspilerFunction · 0.90
getJSXTranspilerFunction · 0.90
getJSXModuleTranspilerFunction · 0.90
getHtmlTranspilerFunction · 0.90

Calls 1

setContentFunction · 0.85

Tested by

no test coverage detected