// Generated by CoffeeScript 2.3.2
(function() {
  var ConfigNode, Pipeline, call;

  ({ConfigNode} = require("@l.degener/irma-config"));

  call = require("../call");

  module.exports = Pipeline = class Pipeline extends ConfigNode {
    transform(request, settings) {
      var filters, reducer, ref;
      filters = (ref = this._options.filters) != null ? ref : [];
      reducer = function(pipeline, filter) {
        return pipeline.then(call(filter)(request, settings));
      };
      return function(input) {
        return filters.reduce(reducer, Promise.resolve(input));
      };
    }

  };

}).call(this);
