Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • URLSearchParams
    • URLSearchParams

Index

Methods

  • Returns IterableIterator<[string, string]>

  • append(name: string, value: string): void
  • Appends a specified key/value pair as a new search parameter.

    Parameters

    • name: string
    • value: string

    Returns void

  • delete(name: string): void
  • Deletes the given search parameter, and its associated value, from the list of all search parameters.

    Parameters

    • name: string

    Returns void

  • Returns an ES6 Iterator over each of the name-value pairs in the query. Each item of the iterator is a JavaScript Array. The first item of the Arrayis the name, the second item of the Array is the value.

    Alias for urlSearchParams[@@iterator]().

    Returns IterableIterator<[string, string]>

  • get(name: string): null | string
  • Returns the first value associated to the given search parameter.

    Parameters

    • name: string

    Returns null | string

  • getAll(name: string): string[]
  • Returns all the values association with a given search parameter.

    Parameters

    • name: string

    Returns string[]

  • has(name: string): boolean
  • Returns a Boolean indicating if such a search parameter exists.

    Parameters

    • name: string

    Returns boolean

  • Returns an ES6 Iterator over the names of each name-value pair.

    const params = new URLSearchParams('foo=bar&#x26;foo=baz');
    for (const name of params.keys()) {
    console.log(name);
    }
    // Prints:
    // foo
    // foo

    Returns IterableIterator<string>

  • set(name: string, value: string): void
  • Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.

    Parameters

    • name: string
    • value: string

    Returns void

  • sort(): void
  • Returns void

  • toString(): string
  • Returns a string containing a query string suitable for use in a URL. Does not include the question mark.

    Returns string

  • Returns an ES6 Iterator over the values of each name-value pair.

    Returns IterableIterator<string>

Generated using TypeDoc