0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

[ci] format

This commit is contained in:
Arsh 2024-03-27 20:38:15 +00:00 committed by astrobot-houston
parent a05953538f
commit 498866c8f2
5 changed files with 7 additions and 10 deletions

View file

@ -9,7 +9,7 @@ export function ensure404Route(manifest: ManifestData) {
params: [], params: [],
pattern: /\/404/, pattern: /\/404/,
prerender: false, prerender: false,
segments: [[{ content: '404', dynamic: false,spread: false }]], segments: [[{ content: '404', dynamic: false, spread: false }]],
type: 'page', type: 'page',
route: '/404', route: '/404',
fallbackRoutes: [], fallbackRoutes: [],

View file

@ -20,8 +20,8 @@ import { MissingIndexForInternationalization } from '../../errors/errors-data.js
import { AstroError } from '../../errors/index.js'; import { AstroError } from '../../errors/index.js';
import { removeLeadingForwardSlash, slash } from '../../path.js'; import { removeLeadingForwardSlash, slash } from '../../path.js';
import { resolvePages } from '../../util.js'; import { resolvePages } from '../../util.js';
import { getRouteGenerator } from './generator.js';
import { routeComparator } from '../priority.js'; import { routeComparator } from '../priority.js';
import { getRouteGenerator } from './generator.js';
const require = createRequire(import.meta.url); const require = createRequire(import.meta.url);
interface Item { interface Item {

View file

@ -1,4 +1,4 @@
import type { RouteData } from "../../@types/astro.js"; import type { RouteData } from '../../@types/astro.js';
/** /**
* Comparator for sorting routes in resolution order. * Comparator for sorting routes in resolution order.

View file

@ -21,8 +21,8 @@ export async function getSortedPreloadedMatches({
settings, settings,
}) })
) )
.sort((a,b) => routeComparator(a.route, b.route)) .sort((a, b) => routeComparator(a.route, b.route))
.sort((a, b) => prioritizePrerenderedMatchesComparator(a.route, b.route)) .sort((a, b) => prioritizePrerenderedMatchesComparator(a.route, b.route));
} }
type PreloadAndSetPrerenderStatusParams = { type PreloadAndSetPrerenderStatusParams = {

View file

@ -285,10 +285,7 @@ export async function handleRoute({
}) })
); );
} }
if ( if (response.status === 404 && response.headers.get(REROUTE_DIRECTIVE_HEADER) !== 'no') {
response.status === 404 &&
response.headers.get(REROUTE_DIRECTIVE_HEADER) !== 'no'
) {
const fourOhFourRoute = await matchRoute('/404', manifestData, pipeline); const fourOhFourRoute = await matchRoute('/404', manifestData, pipeline);
if (options) if (options)
return handleRoute({ return handleRoute({