@eroyeroy/utils - v0.1.0
    Preparing search index...

    Function joinUrl

    • Joins a base URL and a path, normalizing slashes at the boundary.

      Parameters

      • base: string

        The base URL.

      • path: string

        The path segment to append.

      Returns string

      joinUrl("https://example.com/api/", "/users") // => "https://example.com/api/users"
      joinUrl("https://example.com", "users") // => "https://example.com/users"