diff options
-rw-r--r-- | .changeset/polite-roses-fail.md | 5 | ||||
-rw-r--r-- | packages/underscore-redirects/src/astro.ts | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/.changeset/polite-roses-fail.md b/.changeset/polite-roses-fail.md new file mode 100644 index 000000000..a7b3b3f70 --- /dev/null +++ b/.changeset/polite-roses-fail.md @@ -0,0 +1,5 @@ +--- +'@astrojs/underscore-redirects': minor +--- + +Updates the type from `RouteData` to `IntegrationRouteData` diff --git a/packages/underscore-redirects/src/astro.ts b/packages/underscore-redirects/src/astro.ts index 74c3034fb..251de499b 100644 --- a/packages/underscore-redirects/src/astro.ts +++ b/packages/underscore-redirects/src/astro.ts @@ -1,10 +1,10 @@ import { posix } from 'node:path'; -import type { AstroConfig, RouteData, ValidRedirectStatus } from 'astro'; +import type { AstroConfig, IntegrationRouteData, ValidRedirectStatus } from 'astro'; import { Redirects } from './redirects.js'; const pathJoin = posix.join; -function getRedirectStatus(route: RouteData): ValidRedirectStatus { +function getRedirectStatus(route: IntegrationRouteData): ValidRedirectStatus { if (typeof route.redirect === 'object') { return route.redirect.status; } @@ -16,7 +16,7 @@ interface CreateRedirectsFromAstroRoutesParams { /** * Maps a `RouteData` to a dynamic target */ - routeToDynamicTargetMap: Map<RouteData, string>; + routeToDynamicTargetMap: Map<IntegrationRouteData, string>; dir: URL; } @@ -125,7 +125,7 @@ export function createRedirectsFromAstroRoutes({ * /team/articles/* * With stars replacing spread and :id syntax replacing [id] */ -function generateDynamicPattern(route: RouteData) { +function generateDynamicPattern(route: IntegrationRouteData) { const pattern = '/' + route.segments |