new Query()
An object representation of a query string with methods allowing you to read and modify the string.
NOTE: The Query constructor is not exposed. Use bitbucket/util/navbuilder.parseQuery
to create an instance.
- Source:
Methods
-
addParam(paramKey, paramValue) → {bitbucket/util/navbuilder.Query}
-
Add a query parameter value. If the key is already present in the Query, the key will be repeated.
Parameters:
Name Type Description paramKey
string The key/name of the parameter.
paramValue
string The value for the parameter.
- Source:
Returns:
-
deleteParam(paramKey) → {bitbucket/util/navbuilder.Query}
-
Remove a query parameter from the URI.
Parameters:
Name Type Description paramKey
string The key/name of the parameter.
- Source:
Returns:
-
getParamValue(paramKey) → {string}
-
Get a query parameter value. If the key is repeated in the Query, the first instance will be returned.
Parameters:
Name Type Description paramKey
string The key/name of the parameter.
- Source:
Returns:
- Type
- string
-
getParamValues(paramKey) → {Array.<string>}
-
Get an array of query parameter values for a key.
Parameters:
Name Type Description paramKey
string The key/name of the parameter.
- Source:
Returns:
- Type
- Array.<string>
-
replaceParam(paramKey, paramValue) → {bitbucket/util/navbuilder.Query}
-
Add a query parameter value. If the key is already present in the Query, it will be replaced.
Parameters:
Name Type Description paramKey
string The key/name of the parameter.
paramValue
string The value for the parameter.
- Source:
Returns:
-
toString() → {string}
-
Serialize the Query instance.
- Source:
Returns:
- Type
- string