mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
support for especial character
This commit is contained in:
parent
a3e9503ded
commit
f8ae9c1e1a
@ -2,7 +2,16 @@ export default (from, to) => {
|
|||||||
const resolvedUrl = new URL(to, new URL(from, "resolve://"))
|
const resolvedUrl = new URL(to, new URL(from, "resolve://"))
|
||||||
|
|
||||||
if (resolvedUrl.protocol === "resolve:") {
|
if (resolvedUrl.protocol === "resolve:") {
|
||||||
const { pathname, search, hash } = resolvedUrl
|
let { pathname, search, hash } = resolvedUrl
|
||||||
|
|
||||||
|
if (to.includes("@")) {
|
||||||
|
const fromUrl = new URL(from)
|
||||||
|
const toUrl = new URL(to, fromUrl.origin)
|
||||||
|
|
||||||
|
pathname = toUrl.pathname
|
||||||
|
search = toUrl.search
|
||||||
|
hash = toUrl.hash
|
||||||
|
}
|
||||||
|
|
||||||
return pathname + search + hash
|
return pathname + search + hash
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user