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

Function generateGithubLink

client/src/components/create-github-link.ts:6–22  ·  view source on GitHub ↗
(challengeId: string, block: string)

Source from the content-addressed store, hash-verified

4const { curriculumLocale } = envData;
5
6export const generateGithubLink = (challengeId: string, block: string) => {
7 const repository =
8 curriculumLocale === 'english' ? '/freeCodeCamp' : '/i18n-curriculum';
9 const gitURL = new URL(GITHUB_LOCATION);
10
11 gitURL.pathname =
12 gitURL.pathname +
13 [
14 repository,
15 'blob/main/curriculum/challenges',
16 curriculumLocale,
17 'blocks',
18 block,
19 `${challengeId}.md`
20 ].join('/');
21 return gitURL.toString();
22};

Callers 3

ChallengeDescriptionFunction · 0.90
createQuestionEpicFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected