0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -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: [],
pattern: /\/404/,
prerender: false,
segments: [[{ content: '404', dynamic: false,spread: false }]],
segments: [[{ content: '404', dynamic: false, spread: false }]],
type: 'page',
route: '/404',
fallbackRoutes: [],

View file

@ -20,8 +20,8 @@ import { MissingIndexForInternationalization } from '../../errors/errors-data.js
import { AstroError } from '../../errors/index.js';
import { removeLeadingForwardSlash, slash } from '../../path.js';
import { resolvePages } from '../../util.js';
import { getRouteGenerator } from './generator.js';
import { routeComparator } from '../priority.js';
import { getRouteGenerator } from './generator.js';
const require = createRequire(import.meta.url);
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.
@ -102,4 +102,4 @@ export function routeComparator(a: RouteData, b: RouteData) {
// Both routes have segments with the same properties
return a.route.localeCompare(b.route);
}
}

View file

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

View file

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