From 19db3076bd208ba613176082eb26e28e3575d761 Mon Sep 17 00:00:00 2001 From: OpenCoding2026 <231386863+adsadsdd@users.noreply.github.com> Date: Mon, 16 Mar 2026 11:22:42 +0800 Subject: [PATCH] docs: add JSDoc for parseGitHubRemote function Added comprehensive JSDoc documentation including: - Function description - List of supported URL formats - @param and @returns tags Fixes #17689 --- packages/opencode/src/cli/cmd/github.ts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/opencode/src/cli/cmd/github.ts b/packages/opencode/src/cli/cmd/github.ts index edd9d7561094..fe9067aa2767 100644 --- a/packages/opencode/src/cli/cmd/github.ts +++ b/packages/opencode/src/cli/cmd/github.ts @@ -149,13 +149,20 @@ const SUPPORTED_EVENTS = [...USER_EVENTS, ...REPO_EVENTS] as const type UserEvent = (typeof USER_EVENTS)[number] type RepoEvent = (typeof REPO_EVENTS)[number] -// Parses GitHub remote URLs in various formats: -// - https://github.com/owner/repo.git -// - https://github.com/owner/repo -// - git@github.com:owner/repo.git -// - git@github.com:owner/repo -// - ssh://git@github.com/owner/repo.git -// - ssh://git@github.com/owner/repo +/** + * Parses GitHub remote URLs in various formats. + * + * Supported formats: + * - https://github.com/owner/repo.git + * - https://github.com/owner/repo + * - git@github.com:owner/repo.git + * - git@github.com:owner/repo + * - ssh://git@github.com/owner/repo.git + * - ssh://git@github.com/owner/repo + * + * @param url The GitHub remote URL to parse + * @returns Object with owner and repo, or null if parsing fails + */ export function parseGitHubRemote(url: string): { owner: string; repo: string } | null { const match = url.match(/^(?:(?:https?|ssh):\/\/)?(?:git@)?github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?$/) if (!match) return null