Fake Mirrors
    Preparing search index...

    Class HttpUrlWrap

    Wrapper class for HTTP message URLs.

    formatQueryStringOptions: FormatQueryStringOptions = {}

    Custom options for formatting query strings.

    parseQueryStringOptions: ParseQueryStringOptions = {}

    Custom options for parsing query strings.

    • get isFrozen(): boolean

      Checks if the wrapper is frozen (read-only).

      Returns boolean

      true if the wrapper is frozen, false otherwise.

    • Checks if the URL pathname matches a string or regular expression.

      Parameters

      • value: string | RegExp

        The string path or RegExp pattern to match.

      Returns boolean

      true if the pathname matches, false otherwise.

    • Merges a partial URL object into the current URL.

      Parameters

      • url: Partial<HttpUrl>

        The partial URL object with properties to update.

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

    • Resets the URL to default values.

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

    • Sets a URL component by name.

      Type Parameters

      Parameters

      • name: K

        The name of the URL component to set.

      • value: HttpUrl[K]

        The new value for the component.

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

    • Sets the URL query string from an object.

      Parameters

      Returns this

      This wrapper for method chaining.

      Error If the wrapper is frozen.

      Error If formatting the query string fails.

    • Factory method to create a wrapper from an absolute URL string.

      Parameters

      • value: string

        The absolute URL string.

      Returns HttpUrlWrap

      A new wrapper instance.

      Error If the URL cannot be parsed.

    • Factory method to create a wrapper from a relative URL string.

      Parameters

      • value: string

        The relative URL string.

      Returns HttpUrlWrap

      A new wrapper instance.

      Error If the URL cannot be parsed.

    • Factory method to create a wrapper from a request-like object.

      Parameters

      • req: { url?: string }

        The object with an optional url property.

      Returns HttpUrlWrap

      A new wrapper instance.

      Error If req.url is not defined.