@chix/flow
Version:
74 lines • 2.75 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(exports, "__esModule", { value: true });
var identity_1 = require("../common/identity");
var util_1 = require("../util");
var node_1 = require("./node");
function $Report(Base) {
return (function (_super) {
__extends(Report$, _super);
function Report$() {
return _super !== null && _super.apply(this, arguments) || this;
}
Report$.prototype.report = function () {
var e_1, _a;
var _report = {
flow: this.id,
nodes: [],
ok: true,
queues: [],
};
try {
for (var _b = __values(this.nodes.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
var node = _c.value;
if (node.status !== 'complete') {
_report.ok = false;
_report.nodes.push({
node: node.report(),
});
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
return _report;
};
return Report$;
}(Base));
}
exports.$Report = $Report;
(function ($Report) {
function create(Base) {
return util_1.mixin($Report, identity_1.$Identity.create, node_1.$Node.create)(Base);
}
$Report.create = create;
})($Report = exports.$Report || (exports.$Report = {}));
//# sourceMappingURL=report.js.map