@jjdenhertog/ai-driven-development
Version:
AI-driven development workflow with learning capabilities for Claude
15 lines • 676 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBranchName = getBranchName;
function getBranchName(task) {
// Sanitize the task name for use in a git branch name
const brachName = `${task.id} - ${task.name}`;
const sanitizedName = brachName
.toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with hyphens
.replace(/[^\da-z-]/g, '') // Remove special characters except hyphens
.replace(/-+/g, '-') // Replace multiple hyphens with single hyphen
.replace(/^-|-$/g, ''); // Remove leading/trailing hyphens
return `ai/${sanitizedName}`;
}
//# sourceMappingURL=getBranchName.js.map