(input: string)
| 211 | } |
| 212 | |
| 213 | export function parseGitHubRemote(input: string) { |
| 214 | const cleaned = normalizeRepositoryInput(input) |
| 215 | if (!cleaned.includes("://") && !cleaned.match(/^(?:[^@/\s]+@)?github\.com:/)) return null |
| 216 | |
| 217 | const parsed = parseRepositoryReference(cleaned) |
| 218 | if (!parsed || parsed.host !== "github.com" || !parsed.owner || parsed.segments.length !== 2) return null |
| 219 | return { owner: parsed.owner, repo: parsed.repo } |
| 220 | } |
| 221 | |
| 222 | export function repositoryCachePath(input: Reference) { |
| 223 | return path.join(Global.Path.repos, ...input.host.split(":"), ...input.segments) |
no test coverage detected