|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago |
|
Fix frontend appearance
|
-
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.