Function resolveUrl

  • Resolves an URL based on a host/base url, a target endpoint and some query parameters.

    Parameters

    • baseUrl: string | URL

      the host or base url of the resolved url (e.g., new URL('https://google.com/')).

    • endpoint: string

      the target endpoint of the resolved url. If this endpoint ends starts with a slash (/), the resolved url will be treated as absolute, replacing any existing resource on the base URL (e.g., resolveUrl(new URL('https://google.com/search'), '/api)) => https://google.com/api).

    • Optional query: UrlQueryParameters

      the query parameters (if any) to attach in the resolved url.

    Returns URL

    a URL that is the result of the sum of all properties described in the function.

Generated using TypeDoc