Base URL (with or without trailing slash); empty string returns path as-is
Relative path (with or without leading slash); empty string returns base as-is
The two segments joined by exactly one /, or whichever input is non-empty when one is empty
Join a base URL with a relative path using exactly one slash between them.
Tolerant of base URLs that omit the trailing slash and of paths that include a leading slash โ both common foot-guns when callers concatenate URL strings by hand. Empty inputs are passed through: an empty
basereturnspathunchanged, and an emptypathreturnsbaseunchanged (useful for directory listings or when the path is computed conditionally).