scai
Version:
> AI-powered CLI tool for commit messages **and** pull request reviews — using local models.
13 lines (12 loc) • 519 B
JavaScript
import fs from 'fs';
import path from 'path';
import { extractFunctionsFromFile } from './functionExtractors/index.js';
/**
* Extracts functions from file if language is supported.
* Returns true if functions were extracted, false otherwise.
*/
export async function indexFunctionsForFile(filePath, fileId) {
const normalizedPath = path.normalize(filePath).replace(/\\/g, '/');
const content = fs.readFileSync(filePath, 'utf-8');
return await extractFunctionsFromFile(normalizedPath, content, fileId);
}