mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
chore: utils/index.js is updated to .ts (#46556)
* test: utils index is updated to ts * chore: utils.js is added into the .gitignore and .prettierignore
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -168,6 +168,7 @@ config/certification-settings.js
|
||||
### Generated utils files ###
|
||||
utils/slugs.js
|
||||
utils/slugs.test.js
|
||||
utils/index.js
|
||||
|
||||
### vim ###
|
||||
# Swap
|
||||
|
||||
@@ -11,6 +11,7 @@ client/i18n/**/*.json
|
||||
docs/i18n
|
||||
utils/slugs.js
|
||||
utils/slugs.test.js
|
||||
utils/index.js
|
||||
**/package-lock.json
|
||||
web/.next
|
||||
curriculum-server/data/curriculum.json
|
||||
curriculum-server/data/curriculum.json
|
||||
@@ -21,11 +21,11 @@ const idToTitle = new Map(
|
||||
})
|
||||
);
|
||||
|
||||
const idToPath = new Map();
|
||||
const idToPath = new Map<string, string>();
|
||||
|
||||
// Keep the timeline slugs the same so
|
||||
// we don't break existing links
|
||||
const specialPaths = {
|
||||
const specialPaths: Record<string, string> = {
|
||||
'Legacy Full Stack': 'Full Stack',
|
||||
'Legacy Information Security and Quality Assurance':
|
||||
'Information Security and Quality Assurance',
|
||||
@@ -45,5 +45,5 @@ for (const [id, title] of idToTitle) {
|
||||
}
|
||||
|
||||
export const getCertIds = () => idToPath.keys();
|
||||
export const getPathFromID = id => idToPath.get(id);
|
||||
export const getTitleFromId = id => idToTitle.get(id);
|
||||
export const getPathFromID = (id: string) => idToPath.get(id);
|
||||
export const getTitleFromId = (id: string) => idToTitle.get(id);
|
||||
Reference in New Issue
Block a user