(page: string)
| 235 | } |
| 236 | |
| 237 | function normalizePage(page: string): string { |
| 238 | // Resolve on anything that doesn't start with `/` |
| 239 | if (!page.startsWith('/')) { |
| 240 | page = `/${page}`; |
| 241 | } |
| 242 | |
| 243 | // Replace the `/index` with `/` |
| 244 | if (page === '/index') { |
| 245 | page = '/'; |
| 246 | } |
| 247 | |
| 248 | return page; |
| 249 | } |
| 250 | |
| 251 | export type Redirect = Omit<Rewrite, 'destination'> & { |
| 252 | // Redirects can't target a service, so `destination` stays a plain string |
no outgoing calls
no test coverage detected