A codec for encoding and decoding URL parts.
方法
|
---|
Encodes the path from the provided string |
abstract encodePath(path: string): string
abstract encodePath(path: string): string
参数 path | string | The path string |
返回值string
|
|
---|
Decodes the path from the provided string |
abstract decodePath(path: string): string
abstract decodePath(path: string): string
参数 path | string | The path string |
返回值string
|
|
---|
Encodes the search string from the provided string or object |
abstract encodeSearch(search: string | { [k: string]: unknown; }): string
abstract encodeSearch(search: string | { [k: string]: unknown; }): string
参数 search | string | { [k: string]: unknown; } | |
返回值string
|
|
---|
Decodes the search objects from the provided string |
abstract decodeSearch(search: string): { [k: string]: unknown; }
abstract decodeSearch(search: string): {
[k: string]: unknown;
}
参数返回值`{ }` |
|
---|
Encodes the hash from the provided string |
abstract encodeHash(hash: string): string
abstract encodeHash(hash: string): string
参数返回值string
|
|
---|
Decodes the hash from the provided string |
abstract decodeHash(hash: string): string
abstract decodeHash(hash: string): string
参数返回值string
|
|
---|
Normalizes the URL from the provided string |
abstract normalize(href: string): string
abstract normalize(href: string): string
参数返回值string
|
Normalizes the URL from the provided string, search, hash, and base URL parameters abstract normalize(path: string, search: { [k: string]: unknown; }, hash: string, baseUrl?: string): string
abstract normalize(path: string, search: { [k: string]: unknown; }, hash: string, baseUrl?: string): string
参数 path | string | The URL path | search | object | The search object | hash | string | The has string | baseUrl | string | 可选. 默认值是 undefined . The base URL for the URL |
返回值string
|
|
---|
Checks whether the two strings are equal |
abstract areEqual(valA: string, valB: string): boolean
abstract areEqual(valA: string, valB: string): boolean
参数 valA | string | First string for comparison | valB | string | Second string for comparison |
返回值boolean
|
|
---|
Parses the URL string based on the base URL |
abstract parse(url: string, base?: string): { href: string; protocol: string; host: string; search: string; hash: string; hostname: string; port: string; pathname: string; }
abstract parse(url: string, base?: string): {
href: string;
protocol: string;
host: string;
search: string;
hash: string;
hostname: string;
port: string;
pathname: string;
}
参数 url | string | The full URL string | base | string | 可选. 默认值是 undefined . The base for the URL |
返回值{ href: string; protocol: string; host: string; search: string; hash: string; hostname: string; port: string; pathname: string; }
|