A UrlCodec
that uses logic from AngularJS to serialize and parse URLs and URL parameters.
方法
|
---|
encodePath(path: string): string
encodePath(path: string): string
参数返回值string
|
|
---|
encodeSearch(search: string | { [k: string]: unknown; }): string
encodeSearch(search: string | { [k: string]: unknown; }): string
参数 search | string | { [k: string]: unknown; } | |
返回值string
|
|
---|
encodeHash(hash: string)
encodeHash(hash: string)
参数 |
|
---|
decodePath(path: string, html5Mode: boolean = true): string
decodePath(path: string, html5Mode: boolean = true): string
参数 path | string | | html5Mode | boolean | 可选. 默认值是 true . |
返回值string
|
|
---|
decodeSearch(search: string)
decodeSearch(search: string)
参数 |
|
---|
decodeHash(hash: string)
decodeHash(hash: string)
参数 |
|
---|
normalize(href: string): string
normalize(href: string): string
参数返回值string
|
normalize(path: string, search: { [k: string]: unknown; }, hash: string, baseUrl?: string): string
normalize(path: string, search: { [k: string]: unknown; }, hash: string, baseUrl?: string): string
参数 path | string | | search | object | | hash | string | | baseUrl | string | 可选. 默认值是 undefined . |
返回值string
|
|
---|
areEqual(valA: string, valB: string)
areEqual(valA: string, valB: string)
参数 |
|
---|
parse(url: string, base?: string)
parse(url: string, base?: string)
参数 url | string | | base | string | 可选. 默认值是 undefined . |
|