This commit is contained in:
zznty
2024-06-02 21:49:11 +07:00
parent 4146027cb7
commit 529fe260da
585 changed files with 1685 additions and 1214 deletions

View File

@@ -0,0 +1,15 @@
'use strict';
/**
* Creates a new URL by combining the specified URLs
*
* @param {string} baseURL The base URL
* @param {string} relativeURL The relative URL
*
* @returns {string} The combined URL
*/
export default function combineURLs(baseURL, relativeURL) {
return relativeURL
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
: baseURL;
}