Bun

class

URLSearchParams

  • readonly size: number
  • [Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
  • name: string,
    value: string
    ): void;

    Appends a specified key/value pair as a new search parameter.

    MDN Reference

  • name: string,
    value?: string
    ): void;

    Deletes the given search parameter, and its associated value, from the list of all search parameters.

    MDN Reference

  • entries(): URLSearchParamsIterator<[string, string]>;

    Returns an array of key, value pairs for every entry in the search params.

  • callbackfn: (value: string, key: string, parent: URLSearchParams) => void,
    thisArg?: any
    ): void;
  • name: string
    ): null | string;

    Returns the first value associated to the given search parameter.

    MDN Reference

  • name: string
    ): string[];

    Returns all the values association with a given search parameter.

    MDN Reference

  • name: string,
    value?: string
    ): boolean;

    Returns a Boolean indicating if such a search parameter exists.

    MDN Reference

  • keys(): URLSearchParamsIterator<string>;

    Returns a list of keys in the search params.

  • 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.

    MDN Reference

  • toJSON(): Record<string, string>;
  • toString(): string;

    Returns a string containing a query string suitable for use in a URL. Does not include the question mark.

  • values(): URLSearchParamsIterator<string>;

    Returns a list of values in the search params.