Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 97453e4

Browse files
committed
refactor(framework): getPagePathname -> toPagePath
1 parent dfb2dff commit 97453e4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

framework/core/routing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class Routing {
5151
}
5252

5353
update(module: RouteModule) {
54-
const newRoute: Route = { path: getPagePathname(module.url), module }
54+
const newRoute: Route = { path: toPagePath(module.url), module }
5555
const dirtyRoutes: Set<Route[]> = new Set()
5656
let exists = false
5757
let targetRoutes = this._routes
@@ -240,7 +240,7 @@ export function isModuleURL(url: string) {
240240
return false
241241
}
242242

243-
export function getPagePathname(url: string): string {
243+
export function toPagePath(url: string): string {
244244
let pathname = trimModuleExt(url)
245245
if (pathname.startsWith('/pages/')) {
246246
pathname = util.trimPrefix(pathname, '/pages')

framework/react/pageprops.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { ComponentType } from 'https://esm.sh/react'
22
import { RouterURL } from '../../types.ts'
3-
import { getPagePathname } from '../core/routing.ts'
3+
import { toPagePath } from '../core/routing.ts'
44
import { E400MissingComponent } from './error.ts'
55
import { isLikelyReactComponent } from './util.ts'
66

@@ -41,7 +41,7 @@ function createPagePropsSegment(seg: { url: string, Component?: ComponentType<an
4141
pageProps.Page = seg.Component
4242
} else {
4343
pageProps.Page = E400MissingComponent
44-
pageProps.pageProps = { name: 'Page: ' + getPagePathname(seg.url) }
44+
pageProps.pageProps = { name: 'Page: ' + toPagePath(seg.url) }
4545
}
4646
}
4747
return pageProps

0 commit comments

Comments
 (0)