resolve-runtime
Version:
This package create server with resolve.
20 lines (16 loc) • 453 B
JavaScript
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
;