Yuki Takei 10 месяцев назад
Родитель
Сommit
64c5e5335a
1 измененных файлов с 4 добавлено и 0 удалено
  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);
 }