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

Function mapFilesToChallengeFiles

client/src/utils/ajax.ts:137–144  ·  view source on GitHub ↗
(
  fileContainer: ({ files: (File & { key: string })[] } & Rest)[] = []
)

Source from the content-addressed store, hash-verified

135
136// TODO: this at least needs a few aliases so it's human readable
137export function mapFilesToChallengeFiles<File, Rest>(
138 fileContainer: ({ files: (File & { key: string })[] } & Rest)[] = []
139) {
140 return fileContainer.map(({ files, ...rest }) => ({
141 ...rest,
142 challengeFiles: mapKeyToFileKey(files)
143 }));
144}
145
146function mapKeyToFileKey<K>(
147 files: (K & { key: string })[]

Callers 3

postChallengeFunction · 0.90
saveChallengeSagaFunction · 0.90

Calls 1

mapKeyToFileKeyFunction · 0.85

Tested by

no test coverage detected