@eroyeroy/utils - v0.1.0
    Preparing search index...

    Function setQueryParam

    • Sets or replaces a query parameter in a URL string and returns the new URL.

      Parameters

      • url: string

        The base URL string.

      • param: string

        The query parameter name.

      • value: string

        The value to set.

      Returns string

      setQueryParam("https://example.com?q=old", "q", "new")
      // => "https://example.com/?q=new"