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