| | |
| | | dest, |
| | | transformOptions, |
| | | ) |
| | | const canonicalDest = path.posix.normalize(joinSegments(curSlug, dest)) |
| | | |
| | | // url.resolve is considered legacy |
| | | // WHATWG equivalent https://nodejs.dev/en/api/v18/url/#urlresolvefrom-to |
| | | const url = new URL(dest, `https://base.com/${curSlug}`) |
| | | const canonicalDest = url.pathname |
| | | const [destCanonical, _destAnchor] = splitAnchor(canonicalDest) |
| | | const simple = simplifySlug(destCanonical as FullSlug) |
| | | |
| | | // need to decodeURIComponent here as WHATWG URL percent-encodes everything |
| | | const simple = decodeURIComponent( |
| | | simplifySlug(destCanonical as FullSlug), |
| | | ) as SimpleSlug |
| | | outgoing.add(simple) |
| | | } |
| | | |