mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
[ci] format
This commit is contained in:
parent
a05953538f
commit
498866c8f2
5 changed files with 7 additions and 10 deletions
|
@ -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: [],
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue