Clean up comments, docstrings

This commit is contained in:
Cole Davis
2025-09-16 20:54:07 -04:00
parent 1a49e00b3e
commit 35c0ca2406

View File

@@ -79,7 +79,7 @@ export function createBranchTemplateVariables(
} }
/** /**
* Generates a branch name using template or falls back to default format * Generates a branch name from the provided `template` and set of `variables`. Uses a default format if the template is empty or produces an empty result.
*/ */
export function generateBranchName( export function generateBranchName(
template: string | undefined, template: string | undefined,
@@ -102,10 +102,9 @@ export function generateBranchName(
if (template?.trim()) { if (template?.trim()) {
const branchName = applyBranchTemplate(template, variables); const branchName = applyBranchTemplate(template, variables);
// Return generated name if non-empty // Some templates could produce empty results- validate
if (branchName.trim().length > 0) return branchName; if (branchName.trim().length > 0) return branchName;
// Log fallback when custom template produces empty result
console.log( console.log(
`Branch template '${template}' generated empty result, falling back to default format`, `Branch template '${template}' generated empty result, falling back to default format`,
); );