This commit is contained in:
A1300399510
2025-02-20 19:30:25 +08:00
parent 01c731cdb6
commit 69bfb3b262
424 changed files with 86305 additions and 3863 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;
}