(path: string)
| 83 | ]; |
| 84 | |
| 85 | function adevRedirect(path: string) { |
| 86 | return externalRedirect(() => { |
| 87 | const match = window.location.hostname.match(/^([a-zA-Z0-9]+)\.material\.angular\./); |
| 88 | let version: string | null = null; |
| 89 | |
| 90 | if (match) { |
| 91 | // adev doesn't have an RC URL so we route to next. |
| 92 | version = match[1].toLowerCase() === 'rc' ? 'next' : match[1]; |
| 93 | } |
| 94 | |
| 95 | return `https://${version ? version + '.' : ''}angular.dev${path}`; |
| 96 | }); |
| 97 | } |
| 98 | |
| 99 | function externalRedirect(target: string | (() => string)): Partial<Route> { |
| 100 | // Typed explicitly, because `canActivate` also accepts deprecated class-based guards. Any function |
no test coverage detected