(error: unknown)
| 23 | import type {ActivatedRoute} from './router_state'; |
| 24 | |
| 25 | function unwrapRedirectCommand(error: unknown): RedirectCommand | null { |
| 26 | if (error instanceof RedirectCommand) { |
| 27 | return error; |
| 28 | } |
| 29 | if (error && typeof error === 'object' && 'cause' in error) { |
| 30 | return unwrapRedirectCommand((error as {cause: unknown}).cause); |
| 31 | } |
| 32 | return null; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Dispatches a navigation if the given error is (or wraps) a `RedirectCommand`. |
no outgoing calls
no test coverage detected