From e50d75f41fdd80204bbe19d5345c706e309ba103 Mon Sep 17 00:00:00 2001 From: Arsh Date: Wed, 10 Jan 2024 14:53:36 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/core/cookies/cookies.ts | 10 +++++----- .../vercel/src/serverless/adapter.ts | 18 +++++++++++------- 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 ddfb14edf8..862d86ff03 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, 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 db7f428051..3e4934bc21 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 ? {