MCPcopy Create free account
hub / github.com/SIMARSINGHRAYAT/Gitzo / validatePRConfig

Function validatePRConfig

src/App.tsx:35–44  ·  view source on GitHub ↗
(templates: PRTemplate[])

Source from the content-addressed store, hash-verified

33
34// ─── Validation ──────────────────────────────────────────────────────
35function validatePRConfig(templates: PRTemplate[]): string | null {
36 if (templates.length === 0) return 'No pull requests to create. Generate them first.';
37 if (templates.length > MAX_ITEMS) return `Maximum ${MAX_ITEMS} PRs allowed.`;
38 const branchNames = new Set<string>();
39 for (const pr of templates) {
40 if (branchNames.has(pr.branchName)) return `Duplicate branch name: "${pr.branchName}".`;
41 branchNames.add(pr.branchName);
42 }
43 return null;
44}
45
46function validatePairConfig(coAuthors: CoAuthor[], templates: PairTemplate[]): string | null {
47 const validCoAuthors = coAuthors.filter(ca => ca.name.trim() && ca.email.trim());

Callers 1

startCreatingPRsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected