const GITHUB_URL_RE = /github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/;
/**
 * Extract the owner and repository name from a GitHub URL.
 *
 * Supports both HTTPS and SSH-style URLs:
 * - `https://github.com/acme/api`
 * - `https://github.com/acme/api.git`
 * - `git@github.com:acme/api.git`
 *
 * Returns `null` for non-GitHub or unparseable URLs.
 */
export function parseGitUrl(url) {
    const match = url.match(GITHUB_URL_RE);
    if (!match)
        return null;
    return { owner: match[1], repo: match[2] };
}
//# sourceMappingURL=parseGitUrl.js.map