-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(UrlMatcherFactory): merge MatcherConfig into UrlMatcherFactory
- Previously, matcherConfig was a global object, exported from its own es6 module. - Now, matcherConfig is stored per-instance on the UrlMatcherFactory - Previously, Param.from* methods were static on Param class. - Now, urlMatcherFactory has `paramFactory` for creating Param objects
- Loading branch information
1 parent
fddd1e2
commit a7d5fcb
Showing
14 changed files
with
242 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { LocationServices, $InjectorLike, LocationConfig } from "../common/coreservices"; | ||
import { UrlRule } from "./urlRule"; | ||
import { UrlMatcher } from "./urlMatcher"; | ||
import { IInjectable } from "../common/common"; | ||
import { ParamType } from "../params/type"; | ||
import { Param } from "../params/param"; | ||
|
||
export interface ParamFactory { | ||
/** Creates a new [[Param]] from a CONFIG block */ | ||
fromConfig(id: string, type: ParamType, config: any): Param; | ||
/** Creates a new [[Param]] from a url PATH */ | ||
fromPath(id: string, type: ParamType, config: any): Param; | ||
/** Creates a new [[Param]] from a url SEARCH */ | ||
fromSearch(id: string, type: ParamType, config: any): Param; | ||
} | ||
|
||
export interface UrlConfig extends LocationConfig, UrlMatcherConfig {}; | ||
|
||
export interface UrlMatcherConfig { | ||
caseInsensitive(value?: boolean): boolean; | ||
strictMode(value?: boolean): boolean; | ||
defaultSquashPolicy(value?: (boolean|string)): (boolean|string); | ||
paramType(name, type?) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.