summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/core/cookies/cookies.ts10
-rw-r--r--packages/integrations/vercel/src/serverless/adapter.ts18
2 files changed, 16 insertions, 12 deletions
diff --git a/packages/astro/src/core/cookies/cookies.ts b/packages/astro/src/core/cookies/cookies.ts
index ddfb14edf..862d86ff0 100644
--- a/packages/astro/src/core/cookies/cookies.ts
+++ b/packages/astro/src/core/cookies/cookies.ts
@@ -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);
}
diff --git a/packages/integrations/vercel/src/serverless/adapter.ts b/packages/integrations/vercel/src/serverless/adapter.ts
index db7f42805..3e4934bc2 100644
--- a/packages/integrations/vercel/src/serverless/adapter.ts
+++ b/packages/integrations/vercel/src/serverless/adapter.ts
@@ -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
? {