mirror of
https://github.com/tenrok/axios.git
synced 2026-05-18 12:39:44 +03:00
13 lines
348 B
JavaScript
13 lines
348 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
|
|
*/
|
|
module.exports = function combineURLs(baseURL, relativeURL) {
|
|
return baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '');
|
|
};
|