mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor: use cert-slugs where possible (#57505)
This commit is contained in:
committed by
GitHub
parent
cf18718fcc
commit
1690afeb95
@@ -881,29 +881,19 @@ const liveCerts = showUpcomingChanges
|
||||
: [...currentCerts, ...legacyCerts, fullstackCert];
|
||||
|
||||
type CertsToProjects = Record<
|
||||
(typeof allStandardCerts)[number]['title'],
|
||||
(typeof allStandardCerts)[number]['certSlug'],
|
||||
(typeof allStandardCerts)[number]['projects']
|
||||
>;
|
||||
|
||||
const certsToProjects = allStandardCerts.reduce((acc, curr) => {
|
||||
return {
|
||||
...acc,
|
||||
[curr.title]: curr.projects
|
||||
[curr.certSlug]: curr.projects
|
||||
};
|
||||
}, {} as CertsToProjects);
|
||||
|
||||
const currentCertTitles = currentCerts.map(({ title }) => title);
|
||||
const legacyCertTitles = legacyCerts.map(({ title }) => title);
|
||||
const upcomingCertTitles = upcomingCerts.map(({ title }) => title);
|
||||
|
||||
export type CertTitle =
|
||||
| (typeof liveCerts)[number]['title']
|
||||
| 'Legacy Full Stack';
|
||||
|
||||
export {
|
||||
currentCertTitles,
|
||||
legacyCertTitles,
|
||||
upcomingCertTitles,
|
||||
liveCerts,
|
||||
certsToProjects
|
||||
};
|
||||
export { liveCerts, certsToProjects };
|
||||
|
||||
Reference in New Issue
Block a user