From 5759fd994744e641a11b0a404e20291d16287262 Mon Sep 17 00:00:00 2001 From: Luiz Ferraz Date: Wed, 14 Feb 2024 10:07:40 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/core/routing/manifest/create.ts | 8 ++++---- packages/astro/test/units/routing/manifest.nodetest.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/astro/src/core/routing/manifest/create.ts b/packages/astro/src/core/routing/manifest/create.ts index a3170a2cea..93b3770b1d 100644 --- a/packages/astro/src/core/routing/manifest/create.ts +++ b/packages/astro/src/core/routing/manifest/create.ts @@ -761,10 +761,10 @@ export function createRouteManifest( if (defaultLocaleRoutes) { // The index for the default locale will be either already at the root path // or at the root of the locale. - const indexDefaultRoute = defaultLocaleRoutes - .find(({route}) => route === '/') - ?? defaultLocaleRoutes.find(({route}) => route === `/${i18n.defaultLocale}`); - + const indexDefaultRoute = + defaultLocaleRoutes.find(({ route }) => route === '/') ?? + defaultLocaleRoutes.find(({ route }) => route === `/${i18n.defaultLocale}`); + if (indexDefaultRoute) { // we found the index of the default locale, now we create a root index that will redirect to the index of the default locale const pathname = '/'; diff --git a/packages/astro/test/units/routing/manifest.nodetest.js b/packages/astro/test/units/routing/manifest.nodetest.js index 110582bfb8..5e90c6c79b 100644 --- a/packages/astro/test/units/routing/manifest.nodetest.js +++ b/packages/astro/test/units/routing/manifest.nodetest.js @@ -148,7 +148,7 @@ describe('routing - createRouteManifest', () => { ['/[dynamic]', '/[...rest]'], ]); }); - + it('route sorting with multi-layer index page conflict', async () => { // Reproducing regression from https://github.com/withastro/astro/issues/10071 const fs = createFs( @@ -190,7 +190,7 @@ describe('routing - createRouteManifest', () => { ['/a/3', '/'], ['/test', '/'], ['/modules', '/'], - + // Alphabetical order ['/modules', '/test'], ]);