mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-29 22:02:46 -07:00
feat: create [...catch_all] route (#210)
This commit is contained in:
@@ -15,7 +15,6 @@ import {
|
||||
removeGroups,
|
||||
removeLastSlash,
|
||||
removeUnderscores,
|
||||
removeLayoutSegments,
|
||||
} from './utils'
|
||||
|
||||
import type { Config, RouteNode } from './types'
|
||||
@@ -61,8 +60,7 @@ async function getRouteNodes(
|
||||
}
|
||||
const filePath = replaceBackslash(path.join(dir, dirent.name))
|
||||
const filePathNoExt = removeExt(filePath)
|
||||
let routePath =
|
||||
cleanPath(`/${filePathNoExt.split('.').join('/')}`) || ''
|
||||
let routePath = cleanPath(`/${filePathNoExt}`) || ''
|
||||
|
||||
const variableName = routePathToVariable(routePath)
|
||||
|
||||
@@ -139,7 +137,7 @@ export async function routeGenerator(config = defaultConfig): Promise<void> {
|
||||
node.path = determineNodePath(node)
|
||||
|
||||
node.cleanedPath = removeLastSlash(
|
||||
removeGroups(removeUnderscores(removeLayoutSegments(node.path)) ?? ''),
|
||||
removeGroups(removeUnderscores(node.path) ?? ''),
|
||||
)
|
||||
|
||||
if (node.parent) {
|
||||
|
||||
Reference in New Issue
Block a user