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

Function readJsonFile

client/i18n/schema-validation.ts:228–236  ·  view source on GitHub ↗
(language: string, fileName: string)

Source from the content-addressed store, hash-verified

226};
227
228const readJsonFile = async (language: string, fileName: string) => {
229 const filePath = path.join(
230 __dirname,
231 `/locales/${language}/${fileName}.json`
232 );
233 const file = await readFile(filePath, 'utf8');
234 const fileJson = JSON.parse(file) as Record<string, unknown>;
235 return fileJson;
236};
237
238const translatedLangs = availableLangs.client.filter(
239 x => String(x) !== 'english'

Callers 5

introSchemaValidationFunction · 0.85
metaTagsSchemaValidationFunction · 0.85
linksSchemaValidationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected