UNPKG

prompt-helper

Version:

A CLI tool to help you create and manage prompts for AI models.

20 lines 859 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.collectMetrics = collectMetrics; // src/collectors/metricsCollector.ts const fta_cli_1 = require("fta-cli"); /** * Collects code complexity metrics using `fta-cli` and stores them in the project info. * * @param baseDir - The root directory to analyze. * @param projectInfo - The project info object to populate with metric results. */ function collectMetrics(baseDir, projectInfo) { // `runFta` is a synchronous call that returns a JSON string of FtaMetrics[] const results = JSON.parse((0, fta_cli_1.runFta)(baseDir, { json: true })); projectInfo.metrics = results.map(({ file_name, ...rest }) => ({ ...rest, file_name: file_name.replace(/\\/g, '/'), // Normalize path to POSIX-style })); } //# sourceMappingURL=metricsCollector.js.map