UNPKG

openapi-connect

Version:
18 lines 608 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.join = void 0; const url = require("url"); const join = (...paths) => { switch (paths.length) { case 0: return ''; case 1: return paths[0]; default: const [first, ...tailArr] = paths; const tail = tailArr.length > 1 ? (0, exports.join)(...tailArr) : tailArr[0]; return url.resolve(first.endsWith('/') ? first : first + '/', tail.startsWith('/') ? tail.substring(1) : tail); } }; exports.join = join; //# sourceMappingURL=url.js.map