refactor: use cert-slugs where possible (#57505)

This commit is contained in:
Oliver Eyton-Williams
2024-12-13 22:15:41 +01:00
committed by GitHub
parent cf18718fcc
commit 1690afeb95
10 changed files with 165 additions and 270 deletions
+3 -13
View File
@@ -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 };