(args: string)
| 10 | const AZURE_DEVOPS_CLI_PR_CHECKOUT_PATTERN = /^az\s+repos\s+pr\s+checkout\s+(.+)$/i; |
| 11 | |
| 12 | function 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 | |
| 25 | export function parsePullRequestReference(input: string): string | null { |
| 26 | const trimmed = input.trim(); |
no outgoing calls
no test coverage detected