@unito/integration-debugger
Version:
The Unito Integration Debugger
17 lines (16 loc) • 442 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.toSafeUrl = toSafeUrl;
function toSafeUrl(baseUrl, path) {
let absoluteUrl = baseUrl;
if (absoluteUrl.endsWith('/')) {
absoluteUrl = absoluteUrl.slice(0, -1);
}
if (path.startsWith('/')) {
absoluteUrl = `${absoluteUrl}${path}`;
}
else {
absoluteUrl = `${absoluteUrl}/${path}`;
}
return absoluteUrl;
}
;