MCPcopy Create free account
hub / github.com/vercel/vercel / normalizePage

Function normalizePage

packages/next/src/utils.ts:237–249  ·  view source on GitHub ↗
(page: string)

Source from the content-addressed store, hash-verified

235}
236
237function normalizePage(page: string): string {
238 // Resolve on anything that doesn't start with `/`
239 if (!page.startsWith('/')) {
240 page = `/${page}`;
241 }
242
243 // Replace the `/index` with `/`
244 if (page === '/index') {
245 page = '/';
246 }
247
248 return page;
249}
250
251export type Redirect = Omit<Rewrite, 'destination'> & {
252 // Redirects can't target a service, so `destination` stays a plain string

Callers 4

serverBuildFunction · 0.90
buildFunction · 0.90
filterStaticPagesFunction · 0.85
getPageLambdaGroupsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected