index.mjs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. const n = /[^\0-\x7E]/;
  2. const t = /[\x2E\u3002\uFF0E\uFF61]/g;
  3. const o = {
  4. overflow: "Overflow Error",
  5. "not-basic": "Illegal Input",
  6. "invalid-input": "Invalid Input"
  7. };
  8. const e = Math.floor;
  9. const r = String.fromCharCode;
  10. function s(n2) {
  11. throw new RangeError(o[n2]);
  12. }
  13. const c = function(n2, t2) {
  14. return n2 + 22 + 75 * (n2 < 26) - ((t2 != 0) << 5);
  15. };
  16. const u = function(n2, t2, o2) {
  17. let r2 = 0;
  18. for (n2 = o2 ? e(n2 / 700) : n2 >> 1, n2 += e(n2 / t2); n2 > 455; r2 += 36) {
  19. n2 = e(n2 / 35);
  20. }
  21. return e(r2 + 36 * n2 / (n2 + 38));
  22. };
  23. function toASCII(o2) {
  24. return function(n2, o3) {
  25. const e2 = n2.split("@");
  26. let r2 = "";
  27. e2.length > 1 && (r2 = e2[0] + "@", n2 = e2[1]);
  28. const s2 = function(n3, t2) {
  29. const o4 = [];
  30. let e3 = n3.length;
  31. for (; e3--; ) {
  32. o4[e3] = t2(n3[e3]);
  33. }
  34. return o4;
  35. }((n2 = n2.replace(t, ".")).split("."), o3).join(".");
  36. return r2 + s2;
  37. }(o2, function(t2) {
  38. return n.test(t2) ? "xn--" + function(n2) {
  39. const t3 = [];
  40. const o3 = (n2 = function(n3) {
  41. const t4 = [];
  42. let o4 = 0;
  43. const e2 = n3.length;
  44. for (; o4 < e2; ) {
  45. const r2 = n3.charCodeAt(o4++);
  46. if (r2 >= 55296 && r2 <= 56319 && o4 < e2) {
  47. const e3 = n3.charCodeAt(o4++);
  48. (64512 & e3) == 56320 ? t4.push(((1023 & r2) << 10) + (1023 & e3) + 65536) : (t4.push(r2), o4--);
  49. } else {
  50. t4.push(r2);
  51. }
  52. }
  53. return t4;
  54. }(n2)).length;
  55. let f = 128;
  56. let i = 0;
  57. let l = 72;
  58. for (const o4 of n2) {
  59. o4 < 128 && t3.push(r(o4));
  60. }
  61. const h = t3.length;
  62. let p = h;
  63. for (h && t3.push("-"); p < o3; ) {
  64. let o4 = 2147483647;
  65. for (const t4 of n2) {
  66. t4 >= f && t4 < o4 && (o4 = t4);
  67. }
  68. const a = p + 1;
  69. o4 - f > e((2147483647 - i) / a) && s("overflow"), i += (o4 - f) * a, f = o4;
  70. for (const o5 of n2) {
  71. if (o5 < f && ++i > 2147483647 && s("overflow"), o5 == f) {
  72. let n3 = i;
  73. for (let o6 = 36; ; o6 += 36) {
  74. const s2 = o6 <= l ? 1 : o6 >= l + 26 ? 26 : o6 - l;
  75. if (n3 < s2) {
  76. break;
  77. }
  78. const u2 = n3 - s2;
  79. const f2 = 36 - s2;
  80. t3.push(r(c(s2 + u2 % f2, 0))), n3 = e(u2 / f2);
  81. }
  82. t3.push(r(c(n3, 0))), l = u(i, a, p == h), i = 0, ++p;
  83. }
  84. }
  85. ++i, ++f;
  86. }
  87. return t3.join("");
  88. }(t2) : t2;
  89. });
  90. }
  91. const HASH_RE = /#/g;
  92. const AMPERSAND_RE = /&/g;
  93. const SLASH_RE = /\//g;
  94. const EQUAL_RE = /=/g;
  95. const IM_RE = /\?/g;
  96. const PLUS_RE = /\+/g;
  97. const ENC_CARET_RE = /%5e/gi;
  98. const ENC_BACKTICK_RE = /%60/gi;
  99. const ENC_CURLY_OPEN_RE = /%7b/gi;
  100. const ENC_PIPE_RE = /%7c/gi;
  101. const ENC_CURLY_CLOSE_RE = /%7d/gi;
  102. const ENC_SPACE_RE = /%20/gi;
  103. const ENC_SLASH_RE = /%2f/gi;
  104. const ENC_ENC_SLASH_RE = /%252f/gi;
  105. function encode(text) {
  106. return encodeURI("" + text).replace(ENC_PIPE_RE, "|");
  107. }
  108. function encodeHash(text) {
  109. return encode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
  110. }
  111. function encodeQueryValue(input) {
  112. return encode(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F");
  113. }
  114. function encodeQueryKey(text) {
  115. return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
  116. }
  117. function encodePath(text) {
  118. return encode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F").replace(ENC_ENC_SLASH_RE, "%2F").replace(AMPERSAND_RE, "%26").replace(PLUS_RE, "%2B");
  119. }
  120. function encodeParam(text) {
  121. return encodePath(text).replace(SLASH_RE, "%2F");
  122. }
  123. function decode(text = "") {
  124. try {
  125. return decodeURIComponent("" + text);
  126. } catch {
  127. return "" + text;
  128. }
  129. }
  130. function decodePath(text) {
  131. return decode(text.replace(ENC_SLASH_RE, "%252F"));
  132. }
  133. function decodeQueryKey(text) {
  134. return decode(text.replace(PLUS_RE, " "));
  135. }
  136. function decodeQueryValue(text) {
  137. return decode(text.replace(PLUS_RE, " "));
  138. }
  139. function encodeHost(name = "") {
  140. return toASCII(name);
  141. }
  142. function parseQuery(parametersString = "") {
  143. const object = {};
  144. if (parametersString[0] === "?") {
  145. parametersString = parametersString.slice(1);
  146. }
  147. for (const parameter of parametersString.split("&")) {
  148. const s = parameter.match(/([^=]+)=?(.*)/) || [];
  149. if (s.length < 2) {
  150. continue;
  151. }
  152. const key = decodeQueryKey(s[1]);
  153. if (key === "__proto__" || key === "constructor") {
  154. continue;
  155. }
  156. const value = decodeQueryValue(s[2] || "");
  157. if (object[key] === void 0) {
  158. object[key] = value;
  159. } else if (Array.isArray(object[key])) {
  160. object[key].push(value);
  161. } else {
  162. object[key] = [object[key], value];
  163. }
  164. }
  165. return object;
  166. }
  167. function encodeQueryItem(key, value) {
  168. if (typeof value === "number" || typeof value === "boolean") {
  169. value = String(value);
  170. }
  171. if (!value) {
  172. return encodeQueryKey(key);
  173. }
  174. if (Array.isArray(value)) {
  175. return value.map((_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`).join("&");
  176. }
  177. return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`;
  178. }
  179. function stringifyQuery(query) {
  180. return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&");
  181. }
  182. const PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/;
  183. const PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/;
  184. const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/;
  185. const PROTOCOL_SCRIPT_RE = /^[\s\0]*(blob|data|javascript|vbscript):$/i;
  186. const TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
  187. const JOIN_LEADING_SLASH_RE = /^\.?\//;
  188. function isRelative(inputString) {
  189. return ["./", "../"].some((string_) => inputString.startsWith(string_));
  190. }
  191. function hasProtocol(inputString, opts = {}) {
  192. if (typeof opts === "boolean") {
  193. opts = { acceptRelative: opts };
  194. }
  195. if (opts.strict) {
  196. return PROTOCOL_STRICT_REGEX.test(inputString);
  197. }
  198. return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false);
  199. }
  200. function isScriptProtocol(protocol) {
  201. return !!protocol && PROTOCOL_SCRIPT_RE.test(protocol);
  202. }
  203. function hasTrailingSlash(input = "", respectQueryAndFragment) {
  204. if (!respectQueryAndFragment) {
  205. return input.endsWith("/");
  206. }
  207. return TRAILING_SLASH_RE.test(input);
  208. }
  209. function withoutTrailingSlash(input = "", respectQueryAndFragment) {
  210. if (!respectQueryAndFragment) {
  211. return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/";
  212. }
  213. if (!hasTrailingSlash(input, true)) {
  214. return input || "/";
  215. }
  216. let path = input;
  217. let fragment = "";
  218. const fragmentIndex = input.indexOf("#");
  219. if (fragmentIndex >= 0) {
  220. path = input.slice(0, fragmentIndex);
  221. fragment = input.slice(fragmentIndex);
  222. }
  223. const [s0, ...s] = path.split("?");
  224. return (s0.slice(0, -1) || "/") + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
  225. }
  226. function withTrailingSlash(input = "", respectQueryAndFragment) {
  227. if (!respectQueryAndFragment) {
  228. return input.endsWith("/") ? input : input + "/";
  229. }
  230. if (hasTrailingSlash(input, true)) {
  231. return input || "/";
  232. }
  233. let path = input;
  234. let fragment = "";
  235. const fragmentIndex = input.indexOf("#");
  236. if (fragmentIndex >= 0) {
  237. path = input.slice(0, fragmentIndex);
  238. fragment = input.slice(fragmentIndex);
  239. if (!path) {
  240. return fragment;
  241. }
  242. }
  243. const [s0, ...s] = path.split("?");
  244. return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
  245. }
  246. function hasLeadingSlash(input = "") {
  247. return input.startsWith("/");
  248. }
  249. function withoutLeadingSlash(input = "") {
  250. return (hasLeadingSlash(input) ? input.slice(1) : input) || "/";
  251. }
  252. function withLeadingSlash(input = "") {
  253. return hasLeadingSlash(input) ? input : "/" + input;
  254. }
  255. function cleanDoubleSlashes(input = "") {
  256. return input.split("://").map((string_) => string_.replace(/\/{2,}/g, "/")).join("://");
  257. }
  258. function withBase(input, base) {
  259. if (isEmptyURL(base) || hasProtocol(input)) {
  260. return input;
  261. }
  262. const _base = withoutTrailingSlash(base);
  263. if (input.startsWith(_base)) {
  264. return input;
  265. }
  266. return joinURL(_base, input);
  267. }
  268. function withoutBase(input, base) {
  269. if (isEmptyURL(base)) {
  270. return input;
  271. }
  272. const _base = withoutTrailingSlash(base);
  273. if (!input.startsWith(_base)) {
  274. return input;
  275. }
  276. const trimmed = input.slice(_base.length);
  277. return trimmed[0] === "/" ? trimmed : "/" + trimmed;
  278. }
  279. function withQuery(input, query) {
  280. const parsed = parseURL(input);
  281. const mergedQuery = { ...parseQuery(parsed.search), ...query };
  282. parsed.search = stringifyQuery(mergedQuery);
  283. return stringifyParsedURL(parsed);
  284. }
  285. function getQuery(input) {
  286. return parseQuery(parseURL(input).search);
  287. }
  288. function isEmptyURL(url) {
  289. return !url || url === "/";
  290. }
  291. function isNonEmptyURL(url) {
  292. return url && url !== "/";
  293. }
  294. function joinURL(base, ...input) {
  295. let url = base || "";
  296. for (const segment of input.filter((url2) => isNonEmptyURL(url2))) {
  297. if (url) {
  298. const _segment = segment.replace(JOIN_LEADING_SLASH_RE, "");
  299. url = withTrailingSlash(url) + _segment;
  300. } else {
  301. url = segment;
  302. }
  303. }
  304. return url;
  305. }
  306. function withHttp(input) {
  307. return withProtocol(input, "http://");
  308. }
  309. function withHttps(input) {
  310. return withProtocol(input, "https://");
  311. }
  312. function withoutProtocol(input) {
  313. return withProtocol(input, "");
  314. }
  315. function withProtocol(input, protocol) {
  316. const match = input.match(PROTOCOL_REGEX);
  317. if (!match) {
  318. return protocol + input;
  319. }
  320. return protocol + input.slice(match[0].length);
  321. }
  322. function normalizeURL(input) {
  323. const parsed = parseURL(input);
  324. parsed.pathname = encodePath(decodePath(parsed.pathname));
  325. parsed.hash = encodeHash(decode(parsed.hash));
  326. parsed.host = encodeHost(decode(parsed.host));
  327. parsed.search = stringifyQuery(parseQuery(parsed.search));
  328. return stringifyParsedURL(parsed);
  329. }
  330. function resolveURL(base = "", ...inputs) {
  331. if (typeof base !== "string") {
  332. throw new TypeError(
  333. `URL input should be string received ${typeof base} (${base})`
  334. );
  335. }
  336. const filteredInputs = inputs.filter((input) => isNonEmptyURL(input));
  337. if (filteredInputs.length === 0) {
  338. return base;
  339. }
  340. const url = parseURL(base);
  341. for (const inputSegment of filteredInputs) {
  342. const urlSegment = parseURL(inputSegment);
  343. if (urlSegment.pathname) {
  344. url.pathname = withTrailingSlash(url.pathname) + withoutLeadingSlash(urlSegment.pathname);
  345. }
  346. if (urlSegment.hash && urlSegment.hash !== "#") {
  347. url.hash = urlSegment.hash;
  348. }
  349. if (urlSegment.search && urlSegment.search !== "?") {
  350. if (url.search && url.search !== "?") {
  351. const queryString = stringifyQuery({
  352. ...parseQuery(url.search),
  353. ...parseQuery(urlSegment.search)
  354. });
  355. url.search = queryString.length > 0 ? "?" + queryString : "";
  356. } else {
  357. url.search = urlSegment.search;
  358. }
  359. }
  360. }
  361. return stringifyParsedURL(url);
  362. }
  363. function isSamePath(p1, p2) {
  364. return decode(withoutTrailingSlash(p1)) === decode(withoutTrailingSlash(p2));
  365. }
  366. function isEqual(a, b, options = {}) {
  367. if (!options.trailingSlash) {
  368. a = withTrailingSlash(a);
  369. b = withTrailingSlash(b);
  370. }
  371. if (!options.leadingSlash) {
  372. a = withLeadingSlash(a);
  373. b = withLeadingSlash(b);
  374. }
  375. if (!options.encoding) {
  376. a = decode(a);
  377. b = decode(b);
  378. }
  379. return a === b;
  380. }
  381. function withFragment(input, hash) {
  382. if (!hash || hash === "#") {
  383. return input;
  384. }
  385. const parsed = parseURL(input);
  386. parsed.hash = hash === "" ? "" : "#" + encodeHash(hash);
  387. return stringifyParsedURL(parsed);
  388. }
  389. function withoutFragment(input) {
  390. return stringifyParsedURL({ ...parseURL(input), hash: "" });
  391. }
  392. const protocolRelative = Symbol.for("ufo:protocolRelative");
  393. function parseURL(input = "", defaultProto) {
  394. const _specialProtoMatch = input.match(
  395. /^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i
  396. );
  397. if (_specialProtoMatch) {
  398. const [, _proto, _pathname = ""] = _specialProtoMatch;
  399. return {
  400. protocol: _proto.toLowerCase(),
  401. pathname: _pathname,
  402. href: _proto + _pathname,
  403. auth: "",
  404. host: "",
  405. search: "",
  406. hash: ""
  407. };
  408. }
  409. if (!hasProtocol(input, { acceptRelative: true })) {
  410. return defaultProto ? parseURL(defaultProto + input) : parsePath(input);
  411. }
  412. const [, protocol = "", auth, hostAndPath = ""] = input.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [];
  413. const [, host = "", path = ""] = hostAndPath.match(/([^#/?]*)(.*)?/) || [];
  414. const { pathname, search, hash } = parsePath(
  415. path.replace(/\/(?=[A-Za-z]:)/, "")
  416. );
  417. return {
  418. protocol: protocol.toLowerCase(),
  419. auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : "",
  420. host,
  421. pathname,
  422. search,
  423. hash,
  424. [protocolRelative]: !protocol
  425. };
  426. }
  427. function parsePath(input = "") {
  428. const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
  429. return {
  430. pathname,
  431. search,
  432. hash
  433. };
  434. }
  435. function parseAuth(input = "") {
  436. const [username, password] = input.split(":");
  437. return {
  438. username: decode(username),
  439. password: decode(password)
  440. };
  441. }
  442. function parseHost(input = "") {
  443. const [hostname, port] = (input.match(/([^/:]*):?(\d+)?/) || []).splice(1);
  444. return {
  445. hostname: decode(hostname),
  446. port
  447. };
  448. }
  449. function stringifyParsedURL(parsed) {
  450. const pathname = parsed.pathname || "";
  451. const search = parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : "";
  452. const hash = parsed.hash || "";
  453. const auth = parsed.auth ? parsed.auth + "@" : "";
  454. const host = parsed.host || "";
  455. const proto = parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || "") + "//" : "";
  456. return proto + auth + host + pathname + search + hash;
  457. }
  458. const FILENAME_STRICT_REGEX = /\/([^/]+\.[^/]+)$/;
  459. const FILENAME_REGEX = /\/([^/]+)$/;
  460. function parseFilename(input = "", { strict }) {
  461. const { pathname } = parseURL(input);
  462. const matches = strict ? pathname.match(FILENAME_STRICT_REGEX) : pathname.match(FILENAME_REGEX);
  463. return matches ? matches[1] : void 0;
  464. }
  465. var __defProp = Object.defineProperty;
  466. var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  467. var __publicField = (obj, key, value) => {
  468. __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  469. return value;
  470. };
  471. class $URL {
  472. constructor(input = "") {
  473. __publicField(this, "protocol");
  474. __publicField(this, "host");
  475. __publicField(this, "auth");
  476. __publicField(this, "pathname");
  477. __publicField(this, "query", {});
  478. __publicField(this, "hash");
  479. if (typeof input !== "string") {
  480. throw new TypeError(
  481. `URL input should be string received ${typeof input} (${input})`
  482. );
  483. }
  484. const parsed = parseURL(input);
  485. this.protocol = decode(parsed.protocol);
  486. this.host = decode(parsed.host);
  487. this.auth = decode(parsed.auth);
  488. this.pathname = decodePath(parsed.pathname);
  489. this.query = parseQuery(parsed.search);
  490. this.hash = decode(parsed.hash);
  491. }
  492. get hostname() {
  493. return parseHost(this.host).hostname;
  494. }
  495. get port() {
  496. return parseHost(this.host).port || "";
  497. }
  498. get username() {
  499. return parseAuth(this.auth).username;
  500. }
  501. get password() {
  502. return parseAuth(this.auth).password || "";
  503. }
  504. get hasProtocol() {
  505. return this.protocol.length;
  506. }
  507. get isAbsolute() {
  508. return this.hasProtocol || this.pathname[0] === "/";
  509. }
  510. get search() {
  511. const q = stringifyQuery(this.query);
  512. return q.length > 0 ? "?" + q : "";
  513. }
  514. get searchParams() {
  515. const p = new URLSearchParams();
  516. for (const name in this.query) {
  517. const value = this.query[name];
  518. if (Array.isArray(value)) {
  519. for (const v of value) {
  520. p.append(name, v);
  521. }
  522. } else {
  523. p.append(
  524. name,
  525. typeof value === "string" ? value : JSON.stringify(value)
  526. );
  527. }
  528. }
  529. return p;
  530. }
  531. get origin() {
  532. return (this.protocol ? this.protocol + "//" : "") + encodeHost(this.host);
  533. }
  534. get fullpath() {
  535. return encodePath(this.pathname) + this.search + encodeHash(this.hash);
  536. }
  537. get encodedAuth() {
  538. if (!this.auth) {
  539. return "";
  540. }
  541. const { username, password } = parseAuth(this.auth);
  542. return encodeURIComponent(username) + (password ? ":" + encodeURIComponent(password) : "");
  543. }
  544. get href() {
  545. const auth = this.encodedAuth;
  546. const originWithAuth = (this.protocol ? this.protocol + "//" : "") + (auth ? auth + "@" : "") + encodeHost(this.host);
  547. return this.hasProtocol && this.isAbsolute ? originWithAuth + this.fullpath : this.fullpath;
  548. }
  549. append(url) {
  550. if (url.hasProtocol) {
  551. throw new Error("Cannot append a URL with protocol");
  552. }
  553. Object.assign(this.query, url.query);
  554. if (url.pathname) {
  555. this.pathname = withTrailingSlash(this.pathname) + withoutLeadingSlash(url.pathname);
  556. }
  557. if (url.hash) {
  558. this.hash = url.hash;
  559. }
  560. }
  561. toJSON() {
  562. return this.href;
  563. }
  564. toString() {
  565. return this.href;
  566. }
  567. }
  568. function createURL(input) {
  569. return new $URL(input);
  570. }
  571. export { $URL, cleanDoubleSlashes, createURL, decode, decodePath, decodeQueryKey, decodeQueryValue, encode, encodeHash, encodeHost, encodeParam, encodePath, encodeQueryItem, encodeQueryKey, encodeQueryValue, getQuery, hasLeadingSlash, hasProtocol, hasTrailingSlash, isEmptyURL, isEqual, isNonEmptyURL, isRelative, isSamePath, isScriptProtocol, joinURL, normalizeURL, parseAuth, parseFilename, parseHost, parsePath, parseQuery, parseURL, resolveURL, stringifyParsedURL, stringifyQuery, withBase, withFragment, withHttp, withHttps, withLeadingSlash, withProtocol, withQuery, withTrailingSlash, withoutBase, withoutFragment, withoutLeadingSlash, withoutProtocol, withoutTrailingSlash };