From 9d29ef11f680f002efcc5d557ae2d141f348cf0c Mon Sep 17 00:00:00 2001 From: Arsh Date: Fri, 8 Dec 2023 16:26:49 +0000 Subject: [PATCH] [ci] format --- .../astro/src/core/routing/manifest/create.ts | 16 +++++++----- .../integrations/vercel/src/lib/redirects.ts | 26 +++++++++---------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/packages/astro/src/core/routing/manifest/create.ts b/packages/astro/src/core/routing/manifest/create.ts index 66f4a74fac39..19e6e3006d16 100644 --- a/packages/astro/src/core/routing/manifest/create.ts +++ b/packages/astro/src/core/routing/manifest/create.ts @@ -452,15 +452,17 @@ export function createRouteManifest( .join('/')}`.toLowerCase(); { - let destination: string - if (typeof to === "string") { - destination = to - } - else { - destination = to.destination + let destination: string; + if (typeof to === 'string') { + destination = to; + } else { + destination = to.destination; } if (/^https?:\/\//.test(destination)) { - logger.warn('redirects', `Redirecting to an external URL is not officially supported: ${from} -> ${to}`); + logger.warn( + 'redirects', + `Redirecting to an external URL is not officially supported: ${from} -> ${to}` + ); } } diff --git a/packages/integrations/vercel/src/lib/redirects.ts b/packages/integrations/vercel/src/lib/redirects.ts index 7aec1cf3b0b9..35aec2d4f2f0 100644 --- a/packages/integrations/vercel/src/lib/redirects.ts +++ b/packages/integrations/vercel/src/lib/redirects.ts @@ -22,19 +22,19 @@ function getMatchPattern(segments: RoutePart[][]) { return segment[0].spread ? '(?:\\/(.*?))?' : segment - .map((part) => { - if (part) - return part.dynamic - ? '([^/]+?)' - : part.content - .normalize() - .replace(/\?/g, '%3F') - .replace(/#/g, '%23') - .replace(/%5B/g, '[') - .replace(/%5D/g, ']') - .replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); - }) - .join(''); + .map((part) => { + if (part) + return part.dynamic + ? '([^/]+?)' + : part.content + .normalize() + .replace(/\?/g, '%3F') + .replace(/#/g, '%23') + .replace(/%5B/g, '[') + .replace(/%5D/g, ']') + .replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + }) + .join(''); }) .join(''); }