main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "parseRelativeUrl", {
enumerable: true,
get: function() {
return parseRelativeUrl;
}
});
const _utils = require("../../utils");
const _querystring = require("./querystring");
function parseRelativeUrl(url, base) {
const globalBase = new URL(typeof window === "undefined" ? "http://n" : (0, _utils.getLocationOrigin)());
const resolvedBase = base ? new URL(base, globalBase) : url.startsWith(".") ? new URL(typeof window === "undefined" ? "http://n" : window.location.href) : globalBase;
const { pathname, searchParams, search, hash, href, origin } = new URL(url, resolvedBase);
if (origin !== globalBase.origin) {
throw new Error("invariant: invalid relative URL, router received " + url);
}
return {
pathname,
query: (0, _querystring.searchParamsToUrlQuery)(searchParams),
search,
hash,
href: href.slice(globalBase.origin.length)
};
}
//# sourceMappingURL=parse-relative-url.js.map