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

Function decodeFiles

api/src/routes/helpers/challenge-helpers.ts:150–155  ·  view source on GitHub ↗
(files: T[])

Source from the content-addressed store, hash-verified

148 * @returns The same array shape with `contents` decoded.
149 */
150export function decodeFiles<T extends { contents: string }>(files: T[]): T[] {
151 return files.map(file => ({
152 ...file,
153 contents: decodeBase64(file.contents)
154 }));
155}
156
157/**
158 * Decodes a base64 encoded string into a UTF-8 string.

Callers 2

challengeRoutesFunction · 0.85

Calls 1

decodeBase64Function · 0.85

Tested by

no test coverage detected