(destination: string, pathMatch: MatchResult)
| 7 | import nextConfig from "../next.config.js"; |
| 8 | |
| 9 | function getDestination(destination: string, pathMatch: MatchResult): string { |
| 10 | const hasDifferentHost = destination.startsWith("https://"); |
| 11 | if (hasDifferentHost) { |
| 12 | const destinationUrl = new URL(destination); |
| 13 | destinationUrl.pathname = compile(destinationUrl.pathname, { |
| 14 | encode: encodeURIComponent, |
| 15 | })(pathMatch.params); |
| 16 | return destinationUrl.toString(); |
| 17 | } |
| 18 | return compile(destination, { |
| 19 | encode: encodeURIComponent, |
| 20 | })(pathMatch.params); |
| 21 | } |
| 22 | |
| 23 | const BLOG_URL = "https://with-zones-blog.vercel.app"; |
| 24 |
no test coverage detected