Yuki Takei před 1 rokem
rodič
revize
64c5e5335a
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      packages/core/src/utils/path-utils.ts

+ 4 - 0
packages/core/src/utils/path-utils.ts

@@ -4,11 +4,15 @@ function matchSlashes(path: string): RegExpMatchArray | null {
 }
 
 export function hasHeadingSlash(path: string): boolean {
+  if (path === '/') return true;
+
   const match = matchSlashes(path);
   return (match?.[2] != null);
 }
 
 export function hasTrailingSlash(path: string): boolean {
+  if (path === '/') return true;
+
   const match = matchSlashes(path);
   return (match?.[4] != null);
 }