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

Function parseAzureDevOpsCheckoutReference

apps/web/src/pullRequestReference.ts:12–23  ·  view source on GitHub ↗
(args: string)

Source from the content-addressed store, hash-verified

10const AZURE_DEVOPS_CLI_PR_CHECKOUT_PATTERN = /^az\s+repos\s+pr\s+checkout\s+(.+)$/i;
11
12function parseAzureDevOpsCheckoutReference(args: string): string | null {
13 const parts = args.trim().split(/\s+/).filter(Boolean);
14 for (const [index, part] of parts.entries()) {
15 if (part === "--id" || part === "-i") {
16 return parts[index + 1] ?? null;
17 }
18 if (part.startsWith("--id=")) {
19 return part.slice("--id=".length) || null;
20 }
21 }
22 return parts.find((part) => !part.startsWith("-")) ?? null;
23}
24
25export function parsePullRequestReference(input: string): string | null {
26 const trimmed = input.trim();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected