chore: fix typo

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2025-05-12 17:30:44 +08:00
parent 4905d61deb
commit 5e3cebd85f
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
1 changed files with 5 additions and 5 deletions

View File

@ -33,7 +33,7 @@ export function buildGlobRoutes(glob: Record<string, () => Promise<any>>): Route
const routeObject: RouteObject[] = []
function dtsRoutes(
function dfsRoutes(
parentKey: string,
children: RouteObject[],
paths: NestedStructure,
@ -97,7 +97,7 @@ export function buildGlobRoutes(glob: Record<string, () => Promise<any>>): Route
// }
const childrenChildren: RouteObject[] = []
dtsRoutes(`${segmentPathKey}/`, childrenChildren, paths[key]!, parentPath)
dfsRoutes(`${segmentPathKey}/`, childrenChildren, paths[key]!, parentPath)
children.push({
path: "",
lazy: globGetter,
@ -118,7 +118,7 @@ export function buildGlobRoutes(glob: Record<string, () => Promise<any>>): Route
const childrenChildren: RouteObject[] = []
// should omit layout, because layout is already handled
dtsRoutes(parentKey, childrenChildren, omit(paths, "layout") as NestedStructure, parentPath)
dfsRoutes(parentKey, childrenChildren, omit(paths, "layout") as NestedStructure, parentPath)
children.push({
path: "",
lazy: globGetter,
@ -157,7 +157,7 @@ export function buildGlobRoutes(glob: Record<string, () => Promise<any>>): Route
} else {
const childrenChildren: RouteObject[] = []
const fullPath = `${parentPath}/${normalizeKey}`
dtsRoutes(`${segmentPathKey}/`, childrenChildren, paths[key]!, fullPath)
dfsRoutes(`${segmentPathKey}/`, childrenChildren, paths[key]!, fullPath)
children.push({
path: normalizeKey,
children: childrenChildren,
@ -171,7 +171,7 @@ export function buildGlobRoutes(glob: Record<string, () => Promise<any>>): Route
}
}
dtsRoutes("./pages/", routeObject, paths)
dfsRoutes("./pages/", routeObject, paths)
return routeObject
}