@adviser/cement - v0.0.0
    Preparing search index...

    Class BuildURI

    Mutable builder for constructing and manipulating URIs.

    BuildURI provides a fluent API for constructing URIs by chaining method calls. Unlike URI, BuildURI is mutable and allows modification of all URI components (protocol, hostname, port, pathname, search params, hash).

    const uri = BuildURI.from('https://example.com')
    .pathname('/api/users')
    .setParam('page', '1')
    .setParam('limit', '10')
    .toString();
    // Result: "https://example.com/api/users?limit=10&page=1"

    // Building from scratch
    const uri2 = BuildURI.from()
    .protocol('https')
    .hostname('api.example.com')
    .port('8080')
    .pathname('/v1/data')
    .URI(); // Convert to immutable URI

    Implements

    Index

    Constructors

    Properties

    Accessors

    • get onlyHostAndSchema(): string

      Returns string

    • get withoutHostAndSchema(): string

      Returns string

    Methods

    • Parameters

      • ...remove: (string | string[])[]

      Returns BuildURI

    • Parameters

      • val: Record<string, string | number | boolean | Date | null | undefined>
      • mode: "reset" | "merge" = "reset"

      Returns BuildURI

    • Parameters

      • val: Record<string, string | number | boolean | Date | null | undefined>
      • mode: "reset" | "merge" = "reset"

      Returns BuildURI

    • Type Parameters

      • T extends string | undefined

      Parameters

      • key: string | OneKey<string, string>
      • Optionaldef: T

      Returns T extends string ? string : string | undefined