Skip to content

Commit

Permalink
Merge branch 'canary' into shu/jvsq
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Mar 1, 2023
2 parents 253c1b5 + fcfab17 commit 11d688a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/next/src/build/webpack/plugins/next-types-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ function createRouteDefinitions(
}
}

const fallback = !edgeRoutes.length && !nodeRoutes.length ? 'string' : ''
const routes = [...edgeRoutes, ...nodeRoutes, ...extraRoutes]

// By exposing the static route types separately as string literals,
Expand Down Expand Up @@ -267,10 +266,12 @@ declare namespace __next_route_internal_types__ {
type OptionalCatchAllSlug<S extends string> =
S extends \`\${string}\${SearchOrHash}\` ? never : S
type StaticRoutes = ${staticRouteTypes}
type DynamicRoutes<T extends string = string> = ${dynamicRouteTypes}
type StaticRoutes = ${staticRouteTypes || 'string'}
type DynamicRoutes<T extends string = string> = ${
dynamicRouteTypes || 'string'
}
type RouteImpl<T> = ${fallback}
type RouteImpl<T> =
| StaticRoutes
| \`\${StaticRoutes}\${Suffix}\`
| (T extends \`\${DynamicRoutes<infer _>}\${Suffix}\` ? T : never)
Expand Down

0 comments on commit 11d688a

Please sign in to comment.