Lines Matching refs:redirectPath
3 export function getRedirectPath(redirectPath: string): string {
5 if (pathIncludesIndexHtml(redirectPath)) {
6 redirectPath = redirectPath.replace('index.html', '');
10 if (pathIncludesHtmlExtension(redirectPath)) {
11 redirectPath = redirectPath.replace('.html', '');
17 if (endsInNull(redirectPath)) {
18 redirectPath = redirectPath.replace(/null$/, '');
22 if (redirectPath[redirectPath.length - 1] !== '/') {
23 redirectPath = `${redirectPath}/`;
27 if (RENAMED_PAGES[redirectPath]) {
28 redirectPath = RENAMED_PAGES[redirectPath];
32 if (isVersionedPath(redirectPath)) {
33 const unversionedPath = removeVersionFromPath(redirectPath);
35 redirectPath = RENAMED_PAGES[unversionedPath];
40 if (!isVersionDocumented(redirectPath)) {
41 redirectPath = replaceVersionWithLatest(redirectPath);
45 if (isVersionedPath(redirectPath) && !pathRequiresVersioning(redirectPath)) {
46 redirectPath = removeVersionFromPath(redirectPath);
50 if (redirectPath.startsWith('/sdk/')) {
51 redirectPath = `/versions/latest${redirectPath}`;
55 if (redirectPath.match(/\/versions\/.*\/react-native\//)) {
56 const pathParts = redirectPath.split('/');
58 redirectPath = `https://reactnative.dev/docs/${page}`;
62 if (isVersionedPath(redirectPath) && isVersionDocumented(redirectPath)) {
63 redirectPath = `/versions/${getVersionFromPath(redirectPath)}/`;
66 return redirectPath;