Op.js 735 B

1234567891011121314151617181920
  1. var su = require("stream-utils");
  2. /** A base class for all pipeline operators; Handles top-level pipeline operator definitions to provide a Stream that transforms Objects **/
  3. var Op = module.exports = (function(){
  4. // CONSTRUCTOR
  5. var base = su.ThroughStream, proto, klass = function Op(opts){
  6. this.opts = opts;
  7. base.call(this, {write:this.write, end:this.end, reset:this.reset});
  8. };
  9. proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
  10. // PROTOTYPE MEMBERS
  11. //NOTE: see the stream-utils's through() docs for more info
  12. //proto.write = function(obj){ this.queue(obj); }
  13. //proto.end = function(){ this.queue("LAST"); }
  14. //proto.reset = function(){ this.queue("LAST"); }
  15. return klass;
  16. })();