Skip to content

Commit

Permalink
Add doc piece for joinUrl()
Browse files Browse the repository at this point in the history
  • Loading branch information
juj committed Oct 12, 2017
1 parent 2438656 commit 22b5611
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,8 @@ function isAbsoluteUrl(url) {
return /^(?:[a-z]+:)?\/\//i.test(url);
}

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

0 comments on commit 22b5611

Please sign in to comment.