(path: string, campaign: string)
| 4 | * GitHub is the only extension-facing support destination for now. |
| 5 | */ |
| 6 | export function buildDocLink(path: string, campaign: string): string { |
| 7 | // Remove any leading slash from path |
| 8 | const cleanPath = path.replace(/^\//, "") |
| 9 | const [basePath, hash] = cleanPath.split("#") |
| 10 | const baseUrl = `https://docs.zoocode.dev/${basePath}?utm_source=extension&utm_medium=ide&utm_campaign=${encodeURIComponent(campaign)}` |
| 11 | return hash ? `${baseUrl}#${hash}` : baseUrl |
| 12 | } |
no test coverage detected