@remix-run/router 1.23.3 → 1.23.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/router.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/router v1.23.3
2
+ * @remix-run/router v1.23.4
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -881,8 +881,6 @@ function stripBasename(pathname, basename) {
881
881
  }
882
882
  return pathname.slice(startIndex) || "/";
883
883
  }
884
- const ABSOLUTE_URL_REGEX$1 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
885
- const isAbsoluteUrl = url => ABSOLUTE_URL_REGEX$1.test(url);
886
884
  /**
887
885
  * Returns a resolved path object relative to the given pathname.
888
886
  *
@@ -899,19 +897,11 @@ function resolvePath(to, fromPathname) {
899
897
  } = typeof to === "string" ? parsePath(to) : to;
900
898
  let pathname;
901
899
  if (toPathname) {
902
- if (isAbsoluteUrl(toPathname)) {
903
- pathname = toPathname;
900
+ toPathname = removeDoubleSlashes(toPathname);
901
+ if (toPathname.startsWith("/")) {
902
+ pathname = resolvePathname(toPathname.substring(1), "/");
904
903
  } else {
905
- if (toPathname.includes("//")) {
906
- let oldPathname = toPathname;
907
- toPathname = removeDoubleSlashes(toPathname);
908
- warning(false, "Pathnames cannot have embedded double slashes - normalizing " + (oldPathname + " -> " + toPathname));
909
- }
910
- if (toPathname.startsWith("/")) {
911
- pathname = resolvePathname(toPathname.substring(1), "/");
912
- } else {
913
- pathname = resolvePathname(toPathname, fromPathname);
914
- }
904
+ pathname = resolvePathname(toPathname, fromPathname);
915
905
  }
916
906
  } else {
917
907
  pathname = fromPathname;