export default (releaseAnalysis, repoAnalysis) => {
    const pipelinesByRepoName = releaseAnalysis.pipelines.reduce((acc, releasePipeline) => {
        const pipelinesByRepo = Object.values(releasePipeline.repos).reduce((a, { name }) => {
            a[name] = (acc[name] || []).concat(releasePipeline.name);
            return a;
        }, {});
        return Object.assign(acc, pipelinesByRepo);
    }, {});
    return repoAnalysis.map(r => {
        var _a;
        return ({
            ...r,
            pipelineCount: ((_a = pipelinesByRepoName[r.name]) === null || _a === void 0 ? void 0 : _a.length) || undefined,
        });
    });
};
