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:
Palash Gupta
2022-07-25 12:50:14 +05:30
committed by GitHub
parent 9409f86902
commit a745fcb9b3
3 changed files with 7 additions and 5 deletions

1
.gitignore vendored
View File

@@ -168,6 +168,7 @@ config/certification-settings.js
### Generated utils files ### ### Generated utils files ###
utils/slugs.js utils/slugs.js
utils/slugs.test.js utils/slugs.test.js
utils/index.js
### vim ### ### vim ###
# Swap # Swap

View File

@@ -11,6 +11,7 @@ client/i18n/**/*.json
docs/i18n docs/i18n
utils/slugs.js utils/slugs.js
utils/slugs.test.js utils/slugs.test.js
utils/index.js
**/package-lock.json **/package-lock.json
web/.next web/.next
curriculum-server/data/curriculum.json curriculum-server/data/curriculum.json

View File

@@ -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 // Keep the timeline slugs the same so
// we don't break existing links // we don't break existing links
const specialPaths = { const specialPaths: Record<string, string> = {
'Legacy Full Stack': 'Full Stack', 'Legacy Full Stack': 'Full Stack',
'Legacy Information Security and Quality Assurance': 'Legacy Information Security and Quality Assurance':
'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 getCertIds = () => idToPath.keys();
export const getPathFromID = id => idToPath.get(id); export const getPathFromID = (id: string) => idToPath.get(id);
export const getTitleFromId = id => idToTitle.get(id); export const getTitleFromId = (id: string) => idToTitle.get(id);