Skip to content

Commit 22b5611

Browse files
committed
Add doc piece for joinUrl()
1 parent 2438656 commit 22b5611

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
@@ -936,6 +936,8 @@ function isAbsoluteUrl(url) {
936936
return /^(?:[a-z]+:)?\/\//i.test(url);
937937
}
938938

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

0 commit comments

Comments
 (0)