main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
382 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Creates a new URL by combining the specified URLs
|
---|
5 | *
|
---|
6 | * @param {string} baseURL The base URL
|
---|
7 | * @param {string} relativeURL The relative URL
|
---|
8 | *
|
---|
9 | * @returns {string} The combined URL
|
---|
10 | */
|
---|
11 | export default function combineURLs(baseURL, relativeURL) {
|
---|
12 | return relativeURL
|
---|
13 | ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
---|
14 | : baseURL;
|
---|
15 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.