UNPKG

@chix/flow

Version:
57 lines 2.08 kB
"use strict"; 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 __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var forOf = require("object-forof"); var util_1 = require("../util"); var delegate_1 = require("./delegate"); var ports_1 = require("./ports"); function $Output(Base) { return (function (_super) { __extends(Output$, _super); function Output$() { return _super !== null && _super.apply(this, arguments) || this; } Output$.prototype._asyncOutput = function (output) { var _this = this; forOf(function (port, packet) { _this.sendPortOutput(port, packet); }, output); }; Output$.prototype._output = function (output) { var _this = this; if (typeof output === 'function') { ; output.call(this, this._asyncOutput.bind(this)); } else if (Array.isArray(output)) { this._delegate(output); } else { forOf(function (port, packet) { _this.sendPortOutput(port, packet); }, output); } }; return Output$; }(Base)); } exports.$Output = $Output; (function ($Output) { function create(Base) { return util_1.mixin($Output, delegate_1.$Delegate.create, ports_1.$Ports.create)(Base); } $Output.create = create; })($Output = exports.$Output || (exports.$Output = {})); //# sourceMappingURL=output.js.map