codekingpro/portable-devtools
114k
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.join = join;
4const url_1 = require("url");
5function join(base, path) {
6 return new url_1.URL(ensureTrailingSlash(base) + removeLeadingSlash(path)).toString();
7}
8function ensureTrailingSlash(path) {
9 return path.endsWith('/') ? path : path + '/';
10}
11function removeLeadingSlash(path) {
12 return path.startsWith('/') ? path.slice(1) : path;
13}
14 