MCPcopy Create free account
hub / github.com/acoyfellow/cloudbox / gitLabRepoKeyFromRemote

Function gitLabRepoKeyFromRemote

src/http-personal-computers.ts:263–273  ·  view source on GitHub ↗
(remote: string)

Source from the content-addressed store, hash-verified

261}
262
263function 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}

Callers 1

Calls 1

buildGitLabRepoKeyFunction · 0.90

Tested by

no test coverage detected