2021-12-13 21:36:31 +01:00
|
|
|
import { isDynamicRoute } from '../shared/lib/router/utils'
|
|
|
|
|
2020-08-13 14:39:36 +02:00
|
|
|
export function normalizePathSep(path: string): string {
|
|
|
|
return path.replace(/\\/g, '/')
|
|
|
|
}
|
|
|
|
|
|
|
|
export function denormalizePagePath(page: string) {
|
|
|
|
page = normalizePathSep(page)
|
2021-12-13 21:36:31 +01:00
|
|
|
if (page.startsWith('/index/') && !isDynamicRoute(page)) {
|
2020-08-13 14:39:36 +02:00
|
|
|
page = page.slice(6)
|
|
|
|
} else if (page === '/index') {
|
|
|
|
page = '/'
|
|
|
|
}
|
|
|
|
return page
|
|
|
|
}
|