(path: string)
| 18 | |
| 19 | /** Strip trailing .git, /-/* UI paths, and query/hash from a repo path segment. */ |
| 20 | export function cleanRepoPathSegment(path: string): string { |
| 21 | return path |
| 22 | .replace(/\.git$/, "") |
| 23 | .replace(/\/-$/, "") |
| 24 | .replace(/\/-\/.*$/, "") |
| 25 | .replace(/[?#].*$/, "") |
| 26 | .replace(/\/$/, ""); |
| 27 | } |
| 28 | |
| 29 | /** Parse a user-supplied URL or `owner/repo` shorthand into a RepoRef. */ |
| 30 | export function parseRepoInput(input: string): RepoRef | null { |
no outgoing calls
no test coverage detected