@tsdotnet/uri - v1.1.0
    Preparing search index...

    Class Uri

    Provides an read-only model representation of a uniform resource identifier (URI) and easy access to the parts of the URI.

    The read-only model (frozen) is easier for debugging than exposing accessors for each property.

    Implements

    Index

    Constructors

    • Parameters

      • scheme: null | Any

        The user name, password, or other user-specific information associated with the specified URI.

      • userInfo: null | string

        The host component of this instance.

      • host: null | string

        The port number of this URI.

      • port: null | number

        The absolute path of the URI.

      • path: null | string

        The absolute path of the URI.

      • Optionalquery: Convertible

        Any query information included in the specified URI.

      • Optionalfragment: string

        The escaped URI fragment.

      Returns Uri

    Properties

    absoluteUri: string

    The absolute URI.

    authority: null | string

    Gets the Domain Name System (DNS) host name or IP address and the port number for a server.

    baseUri: string

    Gets the full path without the query or fragment.

    fragment: null | string

    The escaped URI fragment.

    host: null | string

    The host component of this instance.

    path: null | string

    The absolute path of the URI.

    pathAndQuery: null | string

    Gets the path and Query properties separated by a question mark (?).

    port: null | number

    The port number of this URI.

    query: null | string

    Gets any query information included in the specified URI.

    queryParams: Readonly<{ [key: string]: Primitive | Primitive[] }>
    scheme: null | Any

    The scheme name for this URI.

    userInfo: null | string

    The user name, password, or other user-specific information associated with the specified URI.

    Accessors

    Methods

    • Compares the values of another IUri via toString comparison.

      Parameters

      Returns boolean

    • Is provided for sub classes to override this value.

      Returns string

    • Is provided for sub classes to override this value.

      Returns string

    • Is provided for sub classes to override this value.

      Returns string

    • Returns string

      The full absolute uri.

    • Parses a URL into it's components.

      Parameters

      • url: string

        The url to parse.

      Returns UriValues

      Will throw an exception if not able to parse.

    • Parses a URL into it's components.

      Parameters

      • url: string

        The url to parse.

      • throwIfInvalid: true

      Returns UriValues

      Will throw an exception if not able to parse.

    • Parses a URL into it's components.

      Parameters

      • url: string

        The url to parse.

      • throwIfInvalid: boolean

        Defaults to true.

      Returns null | UriValues

      Returns a map of the values or null if invalid and throwIfInvalid is false.

    • Parses a URL into it's components.

      Parameters

      • url: string

        The url to parse.

      • out: (result: UriValues) => void

        A delegate to capture the value.

      Returns boolean

      True if valid. False if invalid.