// engine/detectors/advanced-framework-detector/helpers.ts
// Shared file I/O helpers for advanced framework detection.
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
export async function readPackageJson(projectPath) {
    try {
        const content = await readFile(join(projectPath, 'package.json'), 'utf-8');
        return JSON.parse(content);
    }
    catch {
        return {};
    }
}
export function getAllDeps(pkg) {
    return new Set([
        ...Object.keys(pkg.dependencies ?? {}),
        ...Object.keys(pkg.devDependencies ?? {}),
    ]);
}
export async function fileExists(filePath) {
    try {
        await readFile(filePath, 'utf-8');
        return true;
    }
    catch {
        return false;
    }
}
export async function readFileContent(filePath) {
    try {
        return await readFile(filePath, 'utf-8');
    }
    catch {
        return '';
    }
}
//# sourceMappingURL=helpers.js.map