import { basename } from 'node:path';
import { CONFIG_FILE } from '@tanstack/cta-engine';
export function cleanUpFiles(files, targetDir) {
    return Object.keys(files).reduce((acc, file) => {
        const content = files[file].startsWith('base64::')
            ? '<binary file>'
            : files[file];
        if (basename(file) !== CONFIG_FILE) {
            acc[targetDir ? file.replace(targetDir, '.') : file] = content;
        }
        return acc;
    }, {});
}
export function cleanUpFileArray(files, targetDir) {
    return files.reduce((acc, file) => {
        if (basename(file) !== CONFIG_FILE) {
            acc.push(targetDir ? file.replace(targetDir, '.') : file);
        }
        return acc;
    }, []);
}
