MCPcopy Create free account
hub / github.com/pingdotgg/t3code / parseRepositoryPath

Function parseRepositoryPath

apps/server/src/sourceControl/GitLabCli.ts:374–388  ·  view source on GitHub ↗
(repository: string)

Source from the content-addressed store, hash-verified

372}
373
374function parseRepositoryPath(repository: string): {
375 readonly namespacePath: string | null;
376 readonly projectPath: string;
377} {
378 const parts: Array<string> = [];
379 for (const part of repository.split("/")) {
380 const trimmed = part.trim();
381 if (trimmed.length > 0) {
382 parts.push(trimmed);
383 }
384 }
385 const projectPath = parts.at(-1) ?? repository.trim();
386 const namespacePath = parts.length > 1 ? parts.slice(0, -1).join("/") : null;
387 return { namespacePath, projectPath };
388}
389
390export const make = Effect.gen(function* () {
391 const process = yield* VcsProcess.VcsProcess;

Callers 1

GitLabCli.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected