Initializes a new instance of this object.
The protocol to use.
The hostname to connect with.
StaticProtocolA mapping between protocol and default port.
StaticUrlThe url to the gravatar api.
StaticUrlThe url to youtube.
This is mostly used to embed videos.
Fills the information for an api path call.
This is a combination of location, hash with an empty string, and an append of the basePath.
The optional location object to populate with.
The basePath for the api. Generally, it's best to just keep this as api and have your server accept this path.
This object.
Appends a path segment.
The segment to append.
This object.
Builds the url string and returns it.
The url string.
Adds a filter param.
Optionalfilter: string | nullThe filter param to add. If this is null, undefined, or empty, then any filter param is deleted.
This object.
Sets the url for a user gravatar.
Optionalhash: stringThe md5 email hash.
Optionalsize: numberThe dimensional size of the gravatar image.
This object.
Sets the hash section.
The hash section.
This object.
Sets the host name.
This sets the entire hostname as the root domain. This will blow away any subdomains added, so it's best to call this method first.
The hostname.
This object.
Gets the current information about the uri being built.
The current uri information.
Fills the information from the current location data.
The optional location object to populate with.
This object.
Removes all duplicate params and adds one with the key to the value.
The parameter key that can have only one.
Optionalval: stringThe parameter value. If this is falsy, then the key is deleted.
Adds a page param.
Optionalpage: number | nullThe page param to add. If this null, undefined, or less than 1, then any page param is deleted.
This object.
Adds a search parameter.
This version assumes that value is not null.
The parameter key.
The parameter value.
This object.
Parses an existing url and sets all properties.
If you give this a path without the protocol and hostname, then it will automatically append the protocol and host of the browser window if it exists.
This method sets all the properties so if you need to modify the url before parsing it, it is best to always call this method first.
The url to parse.
This object.
Sets the password.
This is only valid if the username is set.
The user password.
This object.
Removes all existing path segments and restarts the path.
The starting path.
This object.
Removes a subdomain from the current domain.
This object.
Sets the port.
The port.
This object.
Sets the protocol.
The protocol.
This object.
Adds a search param.
Optionalsearch: string | nullThe search param to add. If this is null, undefined, or empty, then any search param is deleted.
This object.
Adds a size param.
Optionalsize: number | nullThe size param to add. If this is null, undefined, or less than 0, then any size param is deleted.
This object.
Adds a sort param.
Optionalsort: string | nullThe sort param to add. If this is null, undefined, or empty, then any filter param is deleted.
This object.
Adds a subdomain in front of the hostname.
If a hostname was never set, then domain becomes the hostname.
The domain to append.
This object.
Sets the user name.
Used for things like ssh and ftp.
The username
This object.
Sets the url for a target video on YouTube.
The target api. If this is watch, then it will be a target link to a youTube url. If this is embed, then it will be a target link that can be put into an iframe for embedded youtube videos.
The id of the video to watch.
This object.
Sets the url to the base YouTube domain.
This object.
StaticdefaultsGets whether the given protocols default port is port.
The main purpose of this method is to determine if a url requires a port section. Therefore, there are some special behaviors which may not be obvious:
The protocol to check.
The port to compare.
True if the default port for protocol is port.
Represents an object that is helpful in building a url.