Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy authored and astrobot-houston committed Dec 8, 2023
1 parent 1e342e3 commit 9d29ef1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
16 changes: 9 additions & 7 deletions packages/astro/src/core/routing/manifest/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
);
}
}

Expand Down
26 changes: 13 additions & 13 deletions packages/integrations/vercel/src/lib/redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
}
Expand Down

0 comments on commit 9d29ef1

Please sign in to comment.