mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-22 16:24:48 -06:00
fa9ae9437c
The gitbook install has been incredibly flaky due to it's dependency on npm. This commit simply vendors the node_modules so that each time we build the site the process doesn't have to re-run gitbook install. Signed-off-by: Torin Sandall <torinsandall@gmail.com>
35 lines
735 B
JavaScript
35 lines
735 B
JavaScript
module.exports = Stream;
|
|
|
|
var Parser = require("./WritableStream.js");
|
|
|
|
function Stream(options){
|
|
Parser.call(this, new Cbs(this), options);
|
|
}
|
|
|
|
require("util").inherits(Stream, Parser);
|
|
|
|
Stream.prototype.readable = true;
|
|
|
|
function Cbs(scope){
|
|
this.scope = scope;
|
|
}
|
|
|
|
var EVENTS = require("../").EVENTS;
|
|
|
|
Object.keys(EVENTS).forEach(function(name){
|
|
if(EVENTS[name] === 0){
|
|
Cbs.prototype["on" + name] = function(){
|
|
this.scope.emit(name);
|
|
};
|
|
} else if(EVENTS[name] === 1){
|
|
Cbs.prototype["on" + name] = function(a){
|
|
this.scope.emit(name, a);
|
|
};
|
|
} else if(EVENTS[name] === 2){
|
|
Cbs.prototype["on" + name] = function(a, b){
|
|
this.scope.emit(name, a, b);
|
|
};
|
|
} else {
|
|
throw Error("wrong number of arguments!");
|
|
}
|
|
}); |