Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy authored and astrobot-houston committed Jan 10, 2024
1 parent d7f1903 commit e50d75f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
10 changes: 5 additions & 5 deletions packages/astro/src/core/cookies/cookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
18 changes: 11 additions & 7 deletions packages/integrations/vercel/src/serverless/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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
? {
Expand Down

0 comments on commit e50d75f

Please sign in to comment.