Options
All
  • Public
  • Public/Protected
  • All
Menu

Class URLBuilder

Package version

A class that handles creating, modifying, and parsing URLs.

Hierarchy

  • URLBuilder

Index

Methods

appendPath

  • appendPath(path: string | undefined): void

getHost

  • getHost(): string | undefined

getPath

  • getPath(): string | undefined

getPort

  • getPort(): string | undefined

getQuery

  • getQuery(): string | undefined

getQueryParameterValue

  • getQueryParameterValue(queryParameterName: string): string | string[] | undefined
  • Get the value of the query parameter with the provided query parameter name. If no query parameter exists with the provided name, then undefined will be returned.

    Parameters

    • queryParameterName: string

    Returns string | string[] | undefined

getScheme

  • getScheme(): string | undefined

replaceAll

  • replaceAll(searchValue: string, replaceValue: string): void

setHost

  • setHost(host: string | undefined): void
  • Set the host for this URL. If the provided host contains other parts of a URL (such as a port, path, or query), those parts will be added to this URL as well.

    Parameters

    • host: string | undefined

    Returns void

setPath

  • setPath(path: string | undefined): void

setPort

  • setPort(port: number | string | undefined): void
  • Set the port for this URL. If the provided port contains other parts of a URL (such as a path or query), those parts will be added to this URL as well.

    Parameters

    • port: number | string | undefined

    Returns void

setQuery

  • setQuery(query: string | undefined): void

setQueryParameter

  • setQueryParameter(queryParameterName: string, queryParameterValue: any): void
  • Set a query parameter with the provided name and value in this URL's query. If the provided query parameter value is undefined or empty, then the query parameter will be removed if it existed.

    Parameters

    • queryParameterName: string
    • queryParameterValue: any

    Returns void

setScheme

  • setScheme(scheme: string | undefined): void
  • Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL (such as a host, port, path, or query), those parts will be added to this URL as well.

    Parameters

    • scheme: string | undefined

    Returns void

toString

  • toString(): string

Static parse

Generated using TypeDoc