mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-12 12:04:16 +00:00
11 lines
282 B
JavaScript
11 lines
282 B
JavaScript
export default (from, to) => {
|
|
const resolvedUrl = new URL(to, new URL(from, "resolve://"))
|
|
|
|
if (resolvedUrl.protocol === "resolve:") {
|
|
const { pathname, search, hash } = resolvedUrl
|
|
|
|
return pathname + search + hash
|
|
}
|
|
|
|
return resolvedUrl.toString()
|
|
} |