2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-18 12:39:44 +03:00
Files
axios/lib/helpers/combineURLs.js
T
2015-11-21 17:41:02 -08:00

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(/^\/+/, '');
};