0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

[ci] format

This commit is contained in:
Arsh 2024-01-10 14:53:36 +00:00 committed by astrobot-houston
parent d7f1903cde
commit e50d75f41f
2 changed files with 16 additions and 12 deletions

View file

@ -151,12 +151,12 @@ class AstroCookies implements AstroCookiesInterface {
*/
set(key: string, value: string | Record<string, any>, options?: AstroCookieSetOptions): void {
if (this.#consumed) {
const warning = new Error(
'Astro.cookies.set() was called after the cookies had already been sent to the browser.\n' +
'This may have happened if this method was called in an imported component.\n' +
'Please make sure that Astro.cookies.set() is only called in the frontmatter of the main page.'
const warning = new Error(
'Astro.cookies.set() was called after the cookies had already been sent to the browser.\n' +
'This may have happened if this method was called in an imported component.\n' +
'Please make sure that Astro.cookies.set() is only called in the frontmatter of the main page.'
);
warning.name = "Warning";
warning.name = 'Warning';
// eslint-disable-next-line no-console
console.warn(warning);
}

View file

@ -288,11 +288,11 @@ You can set functionPerRoute: false to prevent surpassing the limit.`
maxDuration,
});
for (const route of routes) {
if (route.prerender) continue
if (route.prerender) continue;
routeDefinitions.push({
src: route.pattern.source,
dest: 'render',
})
});
}
}
const fourOhFourRoute = routes.find((route) => route.pathname === '/404');
@ -309,11 +309,15 @@ You can set functionPerRoute: false to prevent surpassing the limit.`
},
{ handle: 'filesystem' },
...routeDefinitions,
...fourOhFourRoute ? [{
src: '/.*',
dest: fourOhFourRoute.prerender ? '/404.html' : 'render',
status: 404,
}] : [],
...(fourOhFourRoute
? [
{
src: '/.*',
dest: fourOhFourRoute.prerender ? '/404.html' : 'render',
status: 404,
},
]
: []),
],
...(imageService || imagesConfig
? {