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

Function challengeFilesToPolys

curriculum/src/build-superblock.ts:221–231  ·  view source on GitHub ↗
(files: ChallengeFile[])

Source from the content-addressed store, hash-verified

219 * @returns {Array<object>} Array of polyvinyl objects with seed property
220 */
221export function challengeFilesToPolys(files: ChallengeFile[]) {
222 return files.reduce((challengeFiles, challengeFile) => {
223 return [
224 ...challengeFiles,
225 {
226 ...createPoly(challengeFile),
227 seed: challengeFile.contents.slice(0)
228 }
229 ];
230 }, [] as ChallengeFile[]);
231}
232
233/**
234 * Fixes challenge properties by converting files to polyvinyl objects

Callers 1

fixChallengePropertiesFunction · 0.85

Calls 1

createPolyFunction · 0.90

Tested by

no test coverage detected