(
injector: EnvironmentInjector,
routes: Route[],
segmentGroup: UrlSegmentGroup,
segments: UrlSegment[],
outlet: string,
allowRedirects: boolean,
parentRoute: ActivatedRouteSnapshot,
)
| 254 | } |
| 255 | |
| 256 | async processSegment( |
| 257 | injector: EnvironmentInjector, |
| 258 | routes: Route[], |
| 259 | segmentGroup: UrlSegmentGroup, |
| 260 | segments: UrlSegment[], |
| 261 | outlet: string, |
| 262 | allowRedirects: boolean, |
| 263 | parentRoute: ActivatedRouteSnapshot, |
| 264 | ): Promise<TreeNode<ActivatedRouteSnapshot> | NoLeftoversInUrl | NoMatch | AbsoluteRedirect> { |
| 265 | for (const r of routes) { |
| 266 | try { |
| 267 | const result = await this.processSegmentAgainstRoute( |
| 268 | r._injector ?? injector, |
| 269 | routes, |
| 270 | r, |
| 271 | segmentGroup, |
| 272 | segments, |
| 273 | outlet, |
| 274 | allowRedirects, |
| 275 | parentRoute, |
| 276 | ); |
| 277 | if (result instanceof NoMatch) { |
| 278 | continue; |
| 279 | } |
| 280 | return result; |
| 281 | } catch (e: any) { |
| 282 | if (isEmptyError(e)) { |
| 283 | continue; |
| 284 | } |
| 285 | throw e; |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | if (noLeftoversInUrl(segmentGroup, segments, outlet)) { |
| 290 | return new NoLeftoversInUrl(); |
| 291 | } |
| 292 | return new NoMatch(segmentGroup); |
| 293 | } |
| 294 | |
| 295 | async processSegmentAgainstRoute( |
| 296 | injector: EnvironmentInjector, |
no test coverage detected