UNPKG

resolve-runtime

Version:
20 lines (16 loc) 453 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; const isAbsoluteUrl = /:\/\//i; const getRootBasedUrl = (rootPath, path) => { if (isAbsoluteUrl.test(path)) { return path; } const basename = rootPath ? `/${rootPath}` : ''; return `${basename}/${path.replace(/^\//, '')}`; }; var _default = getRootBasedUrl; exports.default = _default; //# sourceMappingURL=get_root_based_url.js.map