(name: string)
| 56 | }); |
| 57 | |
| 58 | function getUrl(name: string) { |
| 59 | if (name.endsWith('/index')) { |
| 60 | name = name.slice(0, -5); |
| 61 | } |
| 62 | |
| 63 | let library = name.slice(0, name.indexOf('/')); |
| 64 | let baseUrl = getBaseUrl(library as any); |
| 65 | if (library === 'react-aria') { |
| 66 | return `${baseUrl}/${name.slice(11)}`; |
| 67 | } else if (library === 's2') { |
| 68 | return `${baseUrl}/${name.slice(3)}`; |
| 69 | } else if (!process.env.LIBRARY) { |
| 70 | return `http://localhost:1234/${name}`; |
| 71 | } else { |
| 72 | throw new Error('Unknown page: ' + name); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | export function getCurrentPage(page: Page): Page { |
| 77 | // Remove .html |
no test coverage detected