summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Arsh <lilnasy@users.noreply.github.com> 2024-01-10 14:53:36 +0000
committerGravatar astrobot-houston <fred+astrobot@astro.build> 2024-01-10 14:53:36 +0000
commite50d75f41fdd80204bbe19d5345c706e309ba103 (patch)
tree163b7e1f7e42cff91a701194ea50deaa4be22f52
parentd7f1903cded3e864b392d1dd7502672d37936f11 (diff)
downloadastro-e50d75f41fdd80204bbe19d5345c706e309ba103.tar.gz
astro-e50d75f41fdd80204bbe19d5345c706e309ba103.tar.zst
astro-e50d75f41fdd80204bbe19d5345c706e309ba103.zip
[ci] format
-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
? {