Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "geocortex/infrastructure/UrlUtilities"

Index

Functions

addQueryParameter

  • addQueryParameter(url: string, parameter: string, value: string): string
  • Adds (or updates) a query parameter in a URL.

    Parameters

    • url: string

      The URL to add a parameter to.

    • parameter: string

      The name of the query parameter to add. If it already exists, the value will be updated.

    • value: string

      The value for the query parameter.

    Returns string

getFolder

  • getFolder(url: string | Location): Location

parseUrl

  • parseUrl(url: string): Location
  • Parses a URL into its component parts. Note that the object returned from this method will suffer from quirks of IE. It's pathname will not have a leading '/', Unless we add it to a document. See https://connect.microsoft.com/IE/Feedback/Details/1002846

    Parameters

    • url: string

      The URL to parse.

    Returns Location

queryStringDictionaryToString

  • queryStringDictionaryToString(queryStrings: Dictionary<string>): string
  • Convert a dictionary of query parameters into a string.

    Parameters

    • queryStrings: Dictionary<string>

      The query string dictionary

    Returns string

    The string of all the query parameters

queryStringToDictionary

  • queryStringToDictionary(queryString: string): Dictionary<string>
  • Parses a URL query string into a dictionary of key/value pairs.

    Parameters

    • queryString: string

    Returns Dictionary<string>

removeParameters

  • removeParameters(url: string | Location): Location
  • Removes all query parameters from the url. Note that the query string and fragment are discarded in the result. Note that the object returned from this method will suffer from quirks of IE. It's pathname will not have a leading '/', Unless we add it to a document. See https://connect.microsoft.com/IE/Feedback/Details/1002846

    Parameters

    • url: string | Location

      The URL to extract the new url from which does not contain query parameters.

    Returns Location

removeQueryParameter

  • removeQueryParameter(url: string, parameter: string): string
  • Removes a query parameter from a URL, if it exists.

    Parameters

    • url: string

      The URL to add a parameter to.

    • parameter: string

      The name of the query parameter to remove.

    Returns string