Skip to content

Commit c0f4dfc

Browse files
committed
Add doc piece for joinUrl()
1 parent 3ae78a1 commit c0f4dfc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/preamble.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,8 @@ function isAbsoluteUrl(url) {
829829
return /^(?:[a-z]+:)?\/\//i.test(url);
830830
}
831831

832+
// Joins relative URL 'b' to URL 'a'. 'a' may be empty, in which case 'b' is returned.
833+
// If 'b' is an absolute URL, then 'a' is ignored and 'b' is returned as-is as well.
832834
function joinUrl(a, b) {
833835
#if ASSERTIONS
834836
if (a && !a.endsWith('/')) throw 'First parameter to joinUrl() should end in /!';

0 commit comments

Comments
 (0)