( results: readonly IntegrationDetectionResult[], )
| 63 | }; |
| 64 | |
| 65 | const bestDetection = ( |
| 66 | results: readonly IntegrationDetectionResult[], |
| 67 | ): IntegrationDetectionResult | undefined => |
| 68 | [...results].sort((a, b) => detectionRank[b.confidence] - detectionRank[a.confidence])[0]; |
| 69 | |
| 70 | // Hosts where a two-segment path (owner/repo) is unambiguously a git remote. |
| 71 | const GIT_REPO_HOSTS = new Set(["github.com", "gitlab.com", "bitbucket.org", "codeberg.org"]); |