"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deduplicateApiTestExecutionResults = deduplicateApiTestExecutionResults;
function deduplicateApiTestExecutionResults(postmanResult) {
    const executionsById = {};
    const orderedExecutionIds = [];
    postmanResult.run.executions?.forEach((execution) => {
        const executionId = execution.id;
        if (!executionsById[executionId]) {
            orderedExecutionIds.push(executionId);
        }
        executionsById[executionId] = execution;
    });
    postmanResult.run.executions = orderedExecutionIds.map((executionId) => executionsById[executionId]);
    return postmanResult;
}
