UrlCodec
A codec for encoding and decoding URL parts.
encodePath
stringEncodes the path from the provided string
stringThe path string
stringdecodePath
stringDecodes the path from the provided string
stringThe path string
stringencodeSearch
stringEncodes the search string from the provided string or object
string | { [k: string]: unknown; }The search string or object
stringdecodeSearch
{ [k: string]: unknown; }Decodes the search objects from the provided string
stringThe search string
{ [k: string]: unknown; }encodeHash
stringEncodes the hash from the provided string
stringThe hash string
stringdecodeHash
stringDecodes the hash from the provided string
stringThe hash string
stringnormalize
2 overloadsNormalizes the URL from the provided string
stringThe URL string
stringNormalizes the URL from the provided string, search, hash, and base URL parameters
stringThe URL path
{ [k: string]: unknown; }The search object
stringThe hash string
string | undefinedThe base URL for the URL
stringareEqual
booleanChecks whether the two strings are equal
stringFirst string for comparison
stringSecond string for comparison
booleanparse
{ href: string; protocol: string; host: string; search: string; hash: string; hostname: string; port: string; pathname: string; }Parses the URL string based on the base URL
stringThe full URL string
string | undefinedThe base for the URL
{ href: string; protocol: string; host: string; search: string; hash: string; hostname: string; port: string; pathname: string; }