From 18c27c6f1d0537a738cbd95898df301b83c38ffc Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Tue, 15 Nov 2022 11:13:54 +0530 Subject: [PATCH] chore: Add docs to redirect.ts --- packages/mermaid/src/docs/.vitepress/redirect.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/mermaid/src/docs/.vitepress/redirect.ts b/packages/mermaid/src/docs/.vitepress/redirect.ts index 6036fcdd9..83cf13026 100644 --- a/packages/mermaid/src/docs/.vitepress/redirect.ts +++ b/packages/mermaid/src/docs/.vitepress/redirect.ts @@ -1,3 +1,7 @@ +/** + * Extracts the base slug from the old URL. + * @param link - The old URL. + */ export const getBaseFile = (link: string): string => { const url = new URL(link); if ( @@ -59,6 +63,11 @@ const redirectMap: Record = { 'user-journey': 'syntax/userJourney', }; +/** + * + * @param link - The old documentation URL. + * @returns The new documentation path. + */ export const getRedirect = (link: string): string | undefined => { const base = getBaseFile(link); return redirectMap[base];