(remote: string)
| 261 | } |
| 262 | |
| 263 | function gitLabRepoKeyFromRemote(remote: string): string | null { |
| 264 | try { |
| 265 | const url = new URL(remote); |
| 266 | if (url.protocol !== "https:" || url.hostname !== "gitlab.cfdata.org") return null; |
| 267 | const repo = url.pathname.replace(/^\//, "").replace(/\.git$/, "").replace(/\/$/, ""); |
| 268 | if (!repo.includes("/") || repo.split("/").some((segment) => !segment || segment === "." || segment === "..")) return null; |
| 269 | return buildGitLabRepoKey(url.hostname, repo); |
| 270 | } catch { |
| 271 | return null; |
| 272 | } |
| 273 | } |
no test coverage detected