@airbolt/sdk
    Preparing search index...

    Function joinUrl

    • Join URL segments safely, handling trailing slashes and empty segments

      Parameters

      • base: string

        The base URL (may contain trailing slashes)

      • ...segments: string[]

        Path segments to append (may contain leading/trailing slashes)

      Returns string

      The properly joined URL

      joinUrl('https://api.example.com/', 'api', 'tokens')
      // Returns: 'https://api.example.com/api/tokens'

      joinUrl('https://api.example.com///', '/api/', '/tokens/')
      // Returns: 'https://api.example.com/api/tokens'