@playlive/tiltify-core
    Preparing search index...

    Function joinURL

    • Joins a base URL and an endpoint path with exactly one / between them, regardless of whether the base has a trailing slash or the path has a leading slash. Prevents accidental double slashes such as https://v5api.tiltify.com/api//public/campaigns/... when a custom base URL is configured or an endpoint is mistakenly prefixed with /.

      Note: query strings and fragments on the path are preserved as-is; only the boundary between base and path is normalized.

      Parameters

      • base: string

        The base URL.

      • path: string

        The endpoint path (with or without a leading slash).

      Returns string

      A single URL string with a single / joining the two pieces.

      joinURL("https://x.com/api/", "/foo") // → "https://x.com/api/foo"