• A helpful function that safely adds query parameters to a relative url. This function will also detect if the url is in fact not a relative url and still behave normally if that is the case.

    The default URL object in javascript only accepts full urls, or relative urls if you know the base However, for the purposes of extracting query parameters, the base url doesn't actually matter.

    Parameters

    • relativeURL: string
    • params: Record<string, string>

    Returns string