Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/axios/lib/helpers/combineURLs.js
1126 views
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
* @returns {string} The combined URL
9
*/
10
module.exports = function combineURLs(baseURL, relativeURL) {
11
return relativeURL
12
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
13
: baseURL;
14
};
15
16