UNPKG

tdd-guard

Version:

TDD Guard enforces Test-Driven Development principles using Claude Code hooks

20 lines (19 loc) 637 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.detectFileType = detectFileType; function detectFileType(hookData) { // Handle different tool operation types const toolInput = hookData.tool_input; if (toolInput && typeof toolInput === 'object' && 'file_path' in toolInput) { const filePath = toolInput.file_path; if (typeof filePath === 'string') { if (filePath.endsWith('.py')) { return 'python'; } if (filePath.endsWith('.php')) { return 'php'; } } } return 'javascript'; }