@sasjs/cli
Version:
Command line interface for SASjs
23 lines (22 loc) • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.allFlowsCompleted = void 0;
var allFlowsCompleted = function (flows) {
var flowNames = Object.keys(flows);
var jobsCount = flowNames.reduce(function (count, name) { return count + flows[name].jobs.length; }, 0);
var jobsWithSuccessStatus = flowNames.reduce(function (count, name) {
return count +
flows[name].jobs.filter(function (job) { return job.status && job.status === 'success'; }).length;
}, 0);
var jobsWithFailureStatus = flowNames.reduce(function (count, name) {
return count +
flows[name].jobs.filter(function (job) { return job.status && job.status !== 'success'; }).length;
}, 0);
return {
completed: jobsCount === jobsWithSuccessStatus ||
jobsCount === jobsWithFailureStatus ||
jobsCount === jobsWithSuccessStatus + jobsWithFailureStatus,
completedWithAllSuccess: jobsCount === jobsWithSuccessStatus
};
};
exports.allFlowsCompleted = allFlowsCompleted;