(
public isAbsolute: boolean,
public numberOfDoubleDots: number,
public commands: readonly any[],
)
| 238 | |
| 239 | class Navigation { |
| 240 | constructor( |
| 241 | public isAbsolute: boolean, |
| 242 | public numberOfDoubleDots: number, |
| 243 | public commands: readonly any[], |
| 244 | ) { |
| 245 | if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) { |
| 246 | throw new RuntimeError( |
| 247 | RuntimeErrorCode.ROOT_SEGMENT_MATRIX_PARAMS, |
| 248 | (typeof ngDevMode === 'undefined' || ngDevMode) && |
| 249 | 'Root segment cannot have matrix parameters', |
| 250 | ); |
| 251 | } |
| 252 | |
| 253 | const cmdWithOutlet = commands.find(isCommandWithOutlets); |
| 254 | if (cmdWithOutlet && cmdWithOutlet !== last(commands)) { |
| 255 | throw new RuntimeError( |
| 256 | RuntimeErrorCode.MISPLACED_OUTLETS_COMMAND, |
| 257 | (typeof ngDevMode === 'undefined' || ngDevMode) && |
| 258 | '{outlets:{}} has to be the last command', |
| 259 | ); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | public toRoot(): boolean { |
| 264 | return this.isAbsolute && this.commands.length === 1 && this.commands[0] == '/'; |
nothing calls this directly
no test coverage detected