URLQuery class

A class that handles the query portion of a URLBuilder.

Methods

any()

Get whether or not there any query parameters in this URLQuery.

get(string)

Get the value of the query parameter with the provided name. If no parameter exists with the provided parameter name, then undefined will be returned.

parse(string)

Parse a URLQuery from the provided text.

set(string, any)

Set a query parameter with the provided name and value. If the parameterValue is undefined or empty, then this will attempt to remove an existing query parameter with the provided parameterName.

toString()

Get the string representation of this query. The return value will not start with a "?".

Method Details

any()

Get whether or not there any query parameters in this URLQuery.

function any(): boolean

Returns

boolean

get(string)

Get the value of the query parameter with the provided name. If no parameter exists with the provided parameter name, then undefined will be returned.

function get(parameterName: string): undefined | string | string[]

Parameters

parameterName

string

Returns

undefined | string | string[]

parse(string)

Parse a URLQuery from the provided text.

static function parse(text: string): URLQuery

Parameters

text

string

Returns

set(string, any)

Set a query parameter with the provided name and value. If the parameterValue is undefined or empty, then this will attempt to remove an existing query parameter with the provided parameterName.

function set(parameterName: string, parameterValue: any)

Parameters

parameterName

string

parameterValue

any

toString()

Get the string representation of this query. The return value will not start with a "?".

function toString(): string

Returns

string