tvbox_config/open/node_modules/axios/lib/helpers/combineURLs.js
liushiquan 36ab603d34 init
2024-06-01 22:41:46 +08:00

16 lines
380 B
JavaScript

'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;
}