fix(router): allow UrlMatcher to return null (#36402)

The matcher is allowed to return null per
https://angular.io/api/router/UrlMatcher#usage-notes

And run `yarn gulp format` to pick up recent clang format changes.

Closes #29824

BREAKING CHANGE: UrlMatcher's type now reflects that it could always return
    null.

    If you implemented your own Router or Recognizer class, please update it to
    handle matcher returning null.

PR Close #36402
This commit is contained in:
Mikel Ward
2020-02-13 13:34:02 -08:00
committed by Kara Erickson
parent a555fdba32
commit 568e9df1d6
2 changed files with 28 additions and 27 deletions

View File

@ -500,7 +500,7 @@ export declare abstract class UrlHandlingStrategy {
abstract shouldProcessUrl(url: UrlTree): boolean;
}
export declare type UrlMatcher = (segments: UrlSegment[], group: UrlSegmentGroup, route: Route) => UrlMatchResult;
export declare type UrlMatcher = (segments: UrlSegment[], group: UrlSegmentGroup, route: Route) => UrlMatchResult | null;
export declare type UrlMatchResult = {
consumed: UrlSegment[];