UNPKG

resolve-runtime

Version:
13 lines (10 loc) 319 B
const isAbsoluteUrl = /:\/\//i; const getRootBasedUrl = (rootPath, path) => { if (isAbsoluteUrl.test(path)) { return path; } const basename = rootPath ? `/${rootPath}` : ''; return `${basename}/${path.replace(/^\//, '')}`; }; export default getRootBasedUrl; //# sourceMappingURL=get_root_based_url.js.map