summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Arsh <lilnasy@users.noreply.github.com> 2023-12-08 16:26:49 +0000
committerGravatar astrobot-houston <fred+astrobot@astro.build> 2023-12-08 16:26:49 +0000
commit9d29ef11f680f002efcc5d557ae2d141f348cf0c (patch)
tree9636eae5955463e3502d5dfd21f1301cae1d9e76
parent1e342e34eb9cef465b838654cea7bb4b0d24e602 (diff)
downloadastro-9d29ef11f680f002efcc5d557ae2d141f348cf0c.tar.gz
astro-9d29ef11f680f002efcc5d557ae2d141f348cf0c.tar.zst
astro-9d29ef11f680f002efcc5d557ae2d141f348cf0c.zip
[ci] format
-rw-r--r--packages/astro/src/core/routing/manifest/create.ts16
-rw-r--r--packages/integrations/vercel/src/lib/redirects.ts26
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 66f4a74fa..19e6e3006 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 7aec1cf3b..35aec2d4f 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('');
}