* Parses the repository string into owner and repo.
(repository: string)
| 36 | * Parses the repository string into owner and repo. |
| 37 | */ |
| 38 | function parseRepo(repository: string): { owner: string; repo: string } { |
| 39 | const cleaned = repository.replace(/^https?:\/\/github\.com\//, '').replace(/\.git$/, '') |
| 40 | const parts = cleaned.split('/') |
| 41 | if (parts.length < 2 || !parts[0] || !parts[1]) { |
| 42 | throw new Error(`Invalid repository format: "${repository}". Use "owner/repo".`) |
| 43 | } |
| 44 | return { owner: parts[0], repo: parts[1] } |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * File extension filter set from user config. Returns null if no filter (accept all). |