Options
All
  • Public
  • Public/Protected
  • All
Menu

This class represents the URL parameters used within each request sent to the SmartSearch backend.

Hierarchy

  • URLParamList

Index

Constructors

constructor

Accessors

list

  • Contains the parameters that are going to be referenced in the methods down below.

    Returns List<URLParam>

Methods

add

  • Adds all given parameters.

    Parameters

    • Rest ...parameters: URLParam[]

      The parameters to add.

    Returns URLParamList

    A new list with the new parameters.

addOrUpdate

  • Adds the given parameters or updates them if they already exist.

    If there are multiple parameters with the same key, only the first parameter is updated. If you want to update multiple parameters with the same key use the deleteAll function first then add the new parameters using add

    Parameters

    • Rest ...parameters: URLParam[]

      The parameters to add or to update.

    Returns URLParamList

    A new list with the new or modified parameters.

addOrUpdateSearchTerm

  • Adds a search term as parameter (with the key query) or updates it if a search term already exists.

    Parameters

    • searchTerm: string

      The search term to add or update.

    Returns URLParamList

    A new list with the new or modified search term. If the search term is empty, a copy of the original list will be returned.

convert

  • convert(parameter: URLParam): string[]
  • Converts a single URLParam into a string array of length 2, with key at position 0 and value at position 1.

    Parameters

    • parameter: URLParam

      The parameter to convert.

    Returns string[]

delete

  • Deletes all parameters matching both keys and values.

    Parameters

    • Rest ...parameters: URLParam[]

      The parameters to be deleted.

    Returns URLParamList

    A new list without the deleted parameters.

deleteAll

  • Deletes all parameters matching the given key.

    Parameters

    • key: string

      The key of the parameters to be deleted.

    Returns URLParamList

    A new list without the deleted parameters.

getMany

  • Returns all parameters matching the given key.

    Parameters

    • key: string

      The key of the searched parameters.

    Returns List<URLParam>

getOne

  • Returns the first parameter matching the given key.

    Parameters

    • key: string

      The key of the searched parameter.

    Returns URLParam | null

toArray

  • Returns URLParam[]

toString

  • toString(): string
  • Converts the stored parameters into a string that can be appended to a URL.

    Returns string

update

  • Updates a specific parameter matching both key and value with the given new parameter.

    Parameters

    • oldParameter: URLParam

      The parameter to update.

    • newParameter: URLParam

      The new parameter to update to.

    Returns URLParamList

    A new list with the updated parameter.

updateFirst

  • Updates the first parameter matching the key if it exists.

    Use this only if you know your parameter is unique. For updating all parameters with the same key, delete them first using deleteAll and then add the new ones.

    Parameters

    • parameter: URLParam

      The parameter to update.

    Returns URLParamList

    A new list with the updated parameter. If the parameter's key doesn't exist, a copy of the original list will be returned.

Generated using TypeDoc